Taxum / @taxum/core / http / Parts
Class: Parts
Defined in: http/request.ts:13
Represents the components of an HTTP request, encapsulating method, URI, version, headers, and optional extensions.
Constructors
Constructor
new Parts(
method
,uri
,version
,headers
,extensions?
):Parts
Defined in: http/request.ts:23
Creates a new Parts.
Parameters
method
uri
URL
version
string
headers
extensions?
Returns
Parts
Properties
extensions
readonly
extensions:Extensions
Defined in: http/request.ts:18
headers
readonly
headers:HeaderMap
Defined in: http/request.ts:17
method
readonly
method:Method
Defined in: http/request.ts:14
uri
readonly
uri:URL
Defined in: http/request.ts:15
version
readonly
version:string
Defined in: http/request.ts:16
Methods
withUri()
withUri(
uri
):Parts
Defined in: http/request.ts:40
Creates a new Parts with the provided URI.
Parameters
uri
URL
Returns
Parts
fromIncomingMessage()
static
fromIncomingMessage(message
,trustProxy
):Parts
Defined in: http/request.ts:53
Creates a new Parts from the provided IncomingMessage.
If trustProxy
is true
, the X-Forwarded-Proto
and X-Forwarded-Host
headers will be used to determine the protocol and host of the request.
Otherwise, the protocol and host will be determined from the IncomingMessage
.
Parameters
message
trustProxy
boolean
Returns
Parts