HTTP.Post is a simple HTTP POST method from the Core library.

Syntax

var body = HTTP.Post(url, contentType, payload [, headerNames, headerValues]);

Parameters

Name Type Required Description
url string Yes Target URL
contentType string Yes MIME type of the request body
payload string Yes Request body string
headerNames string[] No Additional header names
headerValues string[] No Corresponding header values

Return Value

Returns the response body as a string. Does not expose status code — use HTTP.PostRequest if needed.

Examples

Platform.Load("core", "1.1.5");

var payload = Stringify({
    event: "form_submit",
    email: submitterEmail,
    timestamp: Platform.Function.Now()
});

var response = HTTP.Post(
    "https://api.example.com/events",
    "application/json",
    payload,
    ["X-API-Key"],
    ["mysecretkey"]
);
var result = Platform.Function.ParseJSON(response + "");

See Also