{"name":"q-http","version":"0.1.16","description":"Q promise based HTTP client and server interface","homepage":"http://github.com/kriskowal/q-http/","author":{"name":"Kris Kowal","email":"kris@cixar.com","url":"http://github.com/kriskowal/"},"bugs":{"mail":"kris@cixar.com","url":"http://github.com/kriskowal/q-http/issues"},"licenses":[{"type":"MIT","url":"http://github.com/kriskowal/q-http/raw/master/LICENSE"}],"main":"q-http.js","dependencies":{"q":"0.8.x","q-io":"0.0.x"},"devDependencies":{"test":"0.4.1"},"scripts":{"test":"node test/all.js"},"repository":{"type":"git","url":"http://github.com/kriskowal/q-http.git"},"engines":{"node":">=0.4.0"},"_id":"q-http@0.1.16","dist":{"shasum":"f58d4d11a64cc746d266962d8e86611cb1b4655e","tarball":"http://registry-npm.ywwl.com/q-http/download/q-http-0.1.16.tgz","integrity":"sha512-5oSuNmBvyOlhGuYM45IAQOw2yNdhKQsykjKgMs+TazXdHitACwi40VxBp5snWgo5zvOh69cF4nY9F/zG2lPhJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHYE1mmu7pcpdpG+DSzbiRvJYGcf0M0ATvm/8LUYmHcAIgecj2NLrCCrF8jj7kGOuEr7BE37Q4/FpZD7aJoZjPxYY="}],"size":7307,"noattachment":false,"key":"/q-http/-/q-http-0.1.16.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"kriskowal","email":"kris.kowal@cixar.com"},"maintainers":[{"name":"kriskowal","email":"kris.kowal@cixar.com"}],"directories":{},"readme":"\nProvides a Q promise API for HTTP requests and responses.  This should\nresemble JSGI and its hypothetical inverse, but I haven't pored\nthrough the specification to ensure this.\n\nThe API\n-------\n\n-   ``Server(app)``\n    -   accepts an application, returns a server.\n    -   calls the application function when requests are received.\n        -   if the application returns a response object, sends that\n            response.\n    -   ``listen(port)``\n        -   accepts a port number.\n        -   returns a promise for undefined when the server has begun\n            listening.\n    -   ``stop()``\n        -   returns a promise for undefined when the server has stopped.\n-   ``request(request)``\n    -   accepts a request or a URL string.\n    -   returns a promise for a response.\n-   ``read(request)``\n    -   accepts a request or a URL string.\n    -   returns a promise for the response body as a string provided\n        that the request is successful with a 200 status.\n        -   rejects the promise with the response as the reason for\n            failure if the request fails.\n-   ``normalizeRequest(request)``\n    -   coerces URLs into request objects.\n-   ``normalizeResponse(response)\n    -   coerces strings, arrays, and other objects supporting\n        ``forEach`` into proper response objects.\n    -   passes ``undefined`` through as a signal that a request\n        will not receive a response directly.\n-   request\n    -   ``url`` the full URL of the request as a string\n    -   ``path`` the full path as a string\n    -   ``scriptName`` the routed portion of the path, like ``\"\"`` for\n        ``http://example.com/`` if no routing has occurred.\n    -   ``pathInfo`` the part of the path that remains to be routed,\n        like ``/`` for ``http://example.com`` or ``http://example.com/``\n        if no routing has occurred.\n    -   ``version`` the requested HTTP version as an array of strings.\n    -   ``method`` like ``\"GET\"``\n    -   ``scheme`` like ``\"http:\"``\n    -   ``host`` like ``\"example.com\"``\n    -   ``port`` the port number, like ``80``\n    -   ``remoteHost``\n    -   ``remotePort``\n    -   ``headers``\n        corresponding values, possibly an array for multiple headers\n        of the same name.\n    -   ``body``\n    -   ``node`` the wrapped Node request object\n-   response\n    -   ``status`` the HTTP status code as a number, like ``200``.\n    -   ``headers``\n    -   ``body``\n    -   ``onclose`` is an optional function that this library will call\n        when a response concludes.\n    -   ``node`` the wrapped Node response object.\n-   headers are an object mapping lower-case header-names to\n    corresponding values, possibly an array for multiple headers of the\n    same name, for both requests and responses.\n-   body is a representation of a readable stream, either for the\n    content of a request or a response.\n    -   ``forEach(callback)``\n        -   accepts a ``callback(chunk)`` function\n            -   accepts a chunk as either a string or a ``Buffer``\n            -   returns undefined or a promise for undefined when the\n                chunk has been flushed.\n        -   returns undefined or a promise for undefined when the stream\n            is finished writing.\n        -   the ``forEach`` function for arrays of strings or buffers is\n            sufficient for user-provided bodies\n    -   the ``forEach`` function is the only necessary function for\n        bodies provided to this library.\n    -   in addition to ``forEach``, bodies provided by this library\n        support the entire readable stream interface provided by\n        ``q-io``.\n    -   ``read()``\n        -   returns a promise for the entire body as a string or a\n            buffer.\n-   application\n    -   accepts a request\n    -   accepts Node's responder object as a second argument.\n    -   returns a response, a promise for a response, or nothing if no\n        response should be sent.\n\n# Copyright\n\nCopyright 2009, 2010, 2011 Kristopher Michael Kowal\nMIT License (enclosed)\n\n","publish_time":1352314624693,"_cnpm_publish_time":1352314624693,"dist-tags":{"latest":"0.1.16"}}