http.ql
Represents a single HTTP request.
| Constructor | Description |
|---|---|
| HttpRequest(method, url, headers, body) | Creates a new HTTP request. Recommended to use the static factory methods instead. |
| Function | Description |
|---|---|
| static fun create(method, url, headers, body) | Creates a new HTTP request with a specified method, to be sent with HttpClient.send(). |
| static fun createGet(url, headers, body) | Creates a new HTTP GET request to be sent with HttpClient.send(). |
| static fun createPost(url, headers, body) | Creates a new HTTP GET request to be sent with HttpClient.send(). |
| Field | Description |
|---|---|
| string method | The HTTP method to use for the request. |
| string url | The full URL of the request |
| Map headers | The headers to send with the request. Both key and values are strings. |
| string body | The body of the request. |
| int timeout | The timeout for the request in milliseconds. |
| int maxRedirects | The maximum number of redirects to follow. |
Creates a new HTTP request. Recommended to use the static factory methods instead.
Creates a new HTTP request with a specified method, to be sent with HttpClient.send().
method
( string )
|
The HTTP method to use for the request |
url
( string )
|
The URL to send the request to |
headers
( Map )
|
The headers to send with the request |
body
|
The body of the request. May either be a string or a Map |
The created request
Creates a new HTTP GET request to be sent with HttpClient.send().
url
( string )
|
The URL to send the request to |
headers
( Map )
|
The headers to send with the request |
body
|
The body of the request. May either be a string or a Map |
The created request
Creates a new HTTP GET request to be sent with HttpClient.send().
url
( string )
|
The URL to send the request to |
headers
( Map )
|
The headers to send with the request |
body
|
The body of the request. May either be a string or a Map |
The created request