$httpRequest
Performs an HTTP request with the specified content and headers, then returns the response body.
Usage
$httpRequest[URL;Method;Content;Header 1;Header 2;...]
Parameters
Method
Supported HTTP methods:
GETPOSTPUTPATCHDELETEHEAD
If no method is provided, GET is used by default.
Content
The request body to send.
The format of the content should match the Content-Type header. For example, if you specify:
Content-Type: application/json
the content should be valid JSON.
Headers
Headers should be provided in the following format:
Header-Name: Value
For example:
Content-Type: application/json
You can provide as many headers as needed.
Timeout
Requests automatically timeout after 1 minute.
For Tier 4 and above, the timeout is extended to 30 minutes.
Example
Sending a JSON request
Notes
- This function does not throw an error when the server returns a non-success status code (such as
404or500). Always check$httpRequestStatusto verify that the request completed successfully. - The response body must be smaller than 1 MB. Requests that exceed this limit will be rejected.
- The destination URL must be whitelisted before it can be used. If the URL has not yet been approved, please open a ticket in our Support Server to request whitelisting.
Related Functions
Function Difficulty: Medium
Tags: http request api request