To use the HTTP server and client one must require("/http\.js") or include("/http\.js")\.
.sp
The HTTP interfaces in Node are designed to support many features of the protocol which have been traditionally difficult to use\. In particular, large, possibly chunk\-encoded, messages\. The interface is careful to never buffer entire requests or responses\(emthe user is able to stream data\.
.sp
HTTP message headers are represented by an object like this
@ -840,7 +843,7 @@ In order to support the full spectrum of possible HTTP applications, Node\(cqs H
.nran-no-space-flag1
.nran-break-flag1
.br
node.http.Server
http.Server
.RS
.TS
allbox tab(:);
@ -863,7 +866,7 @@ T}:T{
request, response
.sp
T}:T{
request is an instance of node\.http\.ServerRequest response is an instance of node\.http\.ServerResponse
request is an instance of http\.ServerRequest response is an instance of http\.ServerResponse
.sp
T}
T{
@ -873,7 +876,7 @@ T}:T{
connection
.sp
T}:T{
When a new TCP connection is established\. connection is an object of type node\.http\.Connection\. Usually users will not want to access this event\. The connection can also be accessed at request\.connection\.
When a new TCP connection is established\. connection is an object of type http\.Connection\. Usually users will not want to access this event\. The connection can also be accessed at request\.connection\.
.sp
T}
T{
@ -888,7 +891,7 @@ Emitted when the server closes\. errorno is an integer which indicates what, if
@ -922,7 +925,7 @@ Stops the server from accepting new connections\.
.nran-no-space-flag1
.nran-break-flag1
.br
node.http.ServerRequest
http.ServerRequest
.RS
This object is created internally by a HTTP server\(emnot by the user\(emand passed as the first argument to a "request" listener\.
.sp
@ -1047,7 +1050,7 @@ Resumes a paused request\.
request\.connection
.RS4
The
node\.http\.Connection
http\.Connection
object\.
.RE
.RE
@ -1056,7 +1059,7 @@ object\.
.nran-no-space-flag1
.nran-break-flag1
.br
node.http.ServerResponse
http.ServerResponse
.RS
This object is created internally by a HTTP server\(emnot by the user\. It is passed as the second parameter to the "request" event\.
.PP
@ -1116,7 +1119,7 @@ response\.finish(), MUST be called on each response\.
.nran-no-space-flag1
.nran-break-flag1
.br
node.http.Client
http.Client
.RS
An HTTP client is constructed with a server address as its argument, the returned handle is then used to issue one or more requests\. Depending on the server connected to, the client might pipeline the requests or reestablish the connection after each connection\.\fICurrently the implementation does not pipeline requests\.\fR
.sp
@ -1125,7 +1128,7 @@ Example of connecting to google\.com
.sp
.RS4
.nf
var google = node\.http\.createClient(80, "google\.com");
var google = http\.createClient(80, "google\.com");
Issues a request; if necessary establishes connection\. Returns a
node\.http\.ClientRequest
http\.ClientRequest
instance\.
.sp
request_headers
@ -1179,9 +1182,9 @@ request\.sendBody()\.)
.nran-no-space-flag1
.nran-break-flag1
.br
node.http.ClientRequest
http.ClientRequest
.RS
This object is created internally and returned from the request methods of a node\.http\.Client\. It represents an \fIin\-progress\fR request whose header has already been sent\.
This object is created internally and returned from the request methods of a http\.Client\. It represents an \fIin\-progress\fR request whose header has already been sent\.
.sp
.TS
allbox tab(:);
@ -1202,7 +1205,7 @@ T}:T{
response
.sp
T}:T{
Emitted when a response is received to this request\. Typically the user will set a listener to this via the request\.finish() method\. This event is emitted only once\. The response argument will be an instance of node\.http\.ClientResponse\.
Emitted when a response is received to this request\. Typically the user will set a listener to this via the request\.finish() method\. This event is emitted only once\. The response argument will be an instance of http\.ClientResponse\.
.sp
T}
.TE
@ -1237,7 +1240,7 @@ responseListener
is a callback which will be executed when the response headers have been received\. The
responseListener
callback is executed with one argument which is an instance of