Script.Util.HttpRequest
Uses all arguments and methods from the HttpGet() call, along with the listed additional properties. This call performs no caching for email content. Marketing Cloud sets the timeout for this function at 30 seconds.
Script.Util.HttpRequest(1)
Ordinal | Type | Description | |
---|---|---|---|
1 | string | Required | URL from which to perform the GET function |
-
setHeader() - Name and value pairs of headers sent when performing the GET request, which disables content caching
-
removeHeader() - String value indicating header to remove from collection sent with request
-
clearHeader() - String value indicating removal of all custom headers set for the request
-
send() - Perform a send of the request to the website and returns a response data object
-
contentType - String value indicating content type sent with requests using POST method
-
method - String value indicating HTTP method to use:
- GET
- DELETE
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
-
postData String value indicating POST data sent with request - required for POST method
This sample code performs a POST request with a headerTest header and testing=testValue1. The function then writes out the page content from the specified URL and the value of the returnHeader response header.