@minecraft/server-net / HttpRequest
Class: HttpRequest
Defined in: index.d.ts:107
Main object for structuring a request.
Constructors
Constructor
new HttpRequest(
uri):HttpRequest
Defined in: index.d.ts:138
Parameters
uri
string
Returns
HttpRequest
Properties
body
body:
string
Defined in: index.d.ts:111
Content of the body of the HTTP request.
headers
headers:
HttpHeader[]
Defined in: index.d.ts:115
A collection of HTTP headers to add to the outbound request.
method
method:
HttpRequestMethod
Defined in: index.d.ts:120
HTTP method (e.g., GET or PUT or PATCH) to use for making the request.
timeout
timeout:
number
Defined in: index.d.ts:125
Amount of time, in seconds, before the request times out and is abandoned.
uri
uri:
string
Defined in: index.d.ts:129
The HTTP resource to access.
Methods
addHeader()
addHeader(
key,value):HttpRequest
Defined in: index.d.ts:137
Parameters
key
string
value
string | SecretString
Returns
HttpRequest
Remarks
Adds an additional header to the overall list of headers used in the corresponding HTTP request.
setBody()
setBody(
body):HttpRequest
Defined in: index.d.ts:144
Parameters
body
string
Returns
HttpRequest
Remarks
Updates the content of the body of the HTTP request.
setHeaders()
setHeaders(
headers):HttpRequest
Defined in: index.d.ts:150
Parameters
headers
Returns
HttpRequest
Remarks
Replaces and applies a set of HTTP Headers for the request.
setMethod()
setMethod(
method):HttpRequest
Defined in: index.d.ts:151
Parameters
method
Returns
HttpRequest
setTimeout()
setTimeout(
timeout):HttpRequest
Defined in: index.d.ts:152
Parameters
timeout
number
Returns
HttpRequest