ITranslateExpressRequest
Extends
Omit<Request,"protocol"|"param"|"unshift">
Properties
aborted
aborted:
boolean
The message.aborted property will be true if the request has
been aborted.
Since
v10.1.0
Deprecated
Since v17.0.0,v16.12.0 - Check message.destroyed from stream.Readable.
Inherited from
Omit.aborted
accepted
accepted:
MediaType[]
Return an array of Accepted media types ordered from highest quality to lowest.
Inherited from
Omit.accepted
app
app:
Application
Inherited from
Omit.app
baseUrl
baseUrl:
string
Inherited from
Omit.baseUrl
body
body:
any
Inherited from
Omit.body
closed
readonlyclosed:boolean
Is true after 'close' has been emitted.
Since
v18.0.0
Inherited from
Omit.closed
complete
complete:
boolean
The message.complete property will be true if a complete HTTP message has
been received and successfully parsed.
This property is particularly useful as a means of determining if a client or server fully transmitted a message before a connection was terminated:
const req = http.request({
host: '127.0.0.1',
port: 8080,
method: 'POST',
}, (res) => {
res.resume();
res.on('end', () => {
if (!res.complete)
console.error(
'The connection was terminated while the message was still being sent');
});
});
Since
v0.3.0
Inherited from
Omit.complete
connection
connection:
Socket
Alias for message.socket.
Since
v0.1.90
Deprecated
Since v16.0.0 - Use socket.
Inherited from
Omit.connection
cookies
cookies:
any
Inherited from
Omit.cookies
destroyed
destroyed:
boolean
Is true after readable.destroy() has been called.
Since
v8.0.0
Inherited from
Omit.destroyed
errored
readonlyerrored:Error
Returns error if the stream has been destroyed with an error.
Since
v18.0.0
Inherited from
Omit.errored
fresh
readonlyfresh:boolean
Check if the request is fresh, aka Last-Modified and/or the ETag still match.
Inherited from
Omit.fresh
headers
headers:
IncomingHttpHeaders
The request/response headers object.
Key-value pairs of header names and values. Header names are lower-cased.
// Prints something like:
//
// { 'user-agent': 'curl/7.22.0',
// host: '127.0.0.1:8000',
// accept: '*' }
console.log(request.headers);
Duplicates in raw headers are handled in the following ways, depending on the header name:
- Duplicates of
age,authorization,content-length,content-type,etag,expires,from,host,if-modified-since,if-unmodified-since,last-modified,location,max-forwards,proxy-authorization,referer,retry-after,server, oruser-agentare discarded. To allow duplicate values of the headers listed above to be joined, use the optionjoinDuplicateHeadersin request and createServer. See RFC 9110 Section 5.3 for more information. set-cookieis always an array. Duplicates are added to the array.- For duplicate
cookieheaders, the values are joined together with;. - For all other headers, the values are joined together with
,.
Since
v0.1.5
Inherited from
Omit.headers
headersDistinct
headersDistinct:
Dict<string[]>
Similar to message.headers, but there is no join logic and the values are
always arrays of strings, even for headers received just once.
// Prints something like:
//
// { 'user-agent': ['curl/7.22.0'],
// host: ['127.0.0.1:8000'],
// accept: ['*'] }
console.log(request.headersDistinct);
Since
v18.3.0, v16.17.0
Inherited from
Omit.headersDistinct
host
readonlyhost:string
Deprecated
Use hostname instead.
Inherited from
Omit.host
hostname
readonlyhostname:string
Parse the "Host" header field hostname.
Inherited from
Omit.hostname
httpVersion
httpVersion:
string
In case of server request, the HTTP version sent by the client. In the case of
client response, the HTTP version of the connected-to server.
Probably either '1.1' or '1.0'.
Also message.httpVersionMajor is the first integer and message.httpVersionMinor is the second.
Since
v0.1.1
Inherited from
Omit.httpVersion
httpVersionMajor
httpVersionMajor:
number
Inherited from
Omit.httpVersionMajor
httpVersionMinor
httpVersionMinor:
number
Inherited from
Omit.httpVersionMinor
ip
readonlyip:string
Return the remote address, or when
"trust proxy" is true return
the upstream addr.
Value may be undefined if the req.socket is destroyed
(for example, if the client disconnected).
Inherited from
Omit.ip
ips
readonlyips:string[]
When "trust proxy" is true, parse
the "X-Forwarded-For" ip address list.
For example if the value were "client, proxy1, proxy2"
you would receive the array ["client", "proxy1", "proxy2"]
where "proxy2" is the furthest down-stream.
Inherited from
Omit.ips
method
method:
string
Only valid for request obtained from Server.
The request method as a string. Read only. Examples: 'GET', 'DELETE'.
Since
v0.1.1
Inherited from
Omit.method
next?
optionalnext?:NextFunction
Inherited from
Omit.next