TagData
Hierarchy
- HttpDuplex
- TagData
Index
Properties
commit
cwd
exists
repo
req
A IncomingMessage created by http.Server or http.ClientRequest usually passed as the first parameter to the ‘request’ and ‘response’ events. Implements Readable Stream interface but may not be a decendant thereof.
res
Created http.server. Passed as the second parameter to the ‘request’ event. The response implements Writable Stream interface but isn’t a descendent thereof.
version
Accessors
complete
Returns boolean
connection
Reference to the underlying socket for the request connection.
Returns Socket
headers
Request/response headers. Key-value pairs of header names and values. Header names are always lower-case.
Returns IncomingHttpHeaders
httpVersion
Requested HTTP Version sent by the client. Usually either ‘1.0’ or ‘1.1’
Returns string
httpVersionMajor
First integer in the httpVersion string
Returns number
httpVersionMinor
Second integer ni the httpVersion string
Returns number
method
Request method of the incoming request.
Returns undefined | string
readable
Is this stream readable.
Returns boolean
socket
net.Socket object associated with the connection.
Returns Socket
statusCode
The HTTP status code. Generally assigned before sending headers for a response to a client.
Returns number
Parameters
val: number
Returns void
statusMessage
Controls the status message sent to the client as long as an explicit call to response.writeHead() isn’t made If ignored or the value is undefined, the default message corresponding to the status code will be used.
Returns string
Parameters
val: string
Returns void
trailers
Request/response trailer headers. Just like headers except these are only written after the initial response to the client. This object is only populated at the ‘end’ event and only work if a ‘transfer-encoding: chunked’ header is sent in the initial response.
Returns Dict<string>
url
Request URL string.
Returns undefined | string
writable
Returns boolean
Methods
accept
Returns void
cork
Buffers written data in memory. This data will be flushed when either the uncork or end methods are called.
Returns TagData
destroy
Returns void
end
Parameters
optionalreason: any
Returns void
reject
Parameters
code: number
msg: string
Returns void
setHeader
Parameters
arg0: string
arg1: string
Returns void
uncork
Flushes all data buffered since cork() was called.
Returns TagData
writeHead
Sends a response header to the client request. Must only be called one time and before calling response.end().
Parameters
statusCode: number
3-digit HTTP status code, like 404
statusMessage: string
An optional human readable status message to send with the status code
headers: string[]
An object containing the response headers to send
Returns TagData
An http duplex object (see below) with these extra properties: