Issues an HTTP request to a specified URL. This function doesn’t perform caching for email content. The default timeout value for this function is 30 seconds.


1stringRequired. The URL to issue the HTTP request to.

You can call several methods to modify the configuration of the HTTP request.


Sends the request to the destination endpoint.


Excludes a header from the request.


Removes all custom headers from the request.


Adds a header to the request. Specify each header as a name-value pair.

You can’t use the setHeader() method to change the host and content-length headers. The value of host is always set to the domain of the URL that the request was sent to. The value of content-length is always set to the length of the content in the request.

You can also set several properties to tailor the request to your needs.


(String) The content type to use in POST requests, such as application/json or application/x-www-form-urlencoded.


(String) The content encoding to use in POST requests, such as UTF-8.


(String) The HTTP verb to use in the request. Accepted values: GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT.


(String) The request body. This value is required for POST requests.

This example issues a POST request to a destination server.

The example outputs the full body of the response received from the server.