---
schema_version: "1"
id: 1f042213ec69ca7bd3953c4a8fbd549b994aabcceff1c46e407010a6ea280b52
title: HTTP.Post()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_httpPost.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_httpPost.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 15ee2c5b97bf1582d231c4e6d2ef543de6a729b97eb04bd92a3d74175efbb349
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# HTTP.Post()

Issues an HTTP POST request to the provided URL. The function returns a JSON object that contains a status value and the HTTP response.

This function only works with HTTP on port 80 and HTTPS on port 443.

## Syntax

```
HTTP.Post(destinationUrl, contentType, content, headerNames[], headerValues[])
```

The `HTTP.Post()` function has these parameters.

- `destinationUrl` (string): Required. The destination URL for the HTTP POST request.
- `contentType` (string): Required. The value to pass for the Content-Type header.
- `content` (string): Required. The content of the POST request.
- `headerNames` (array): Required. An array of header names to include in the request.
- `headerValues` (array): Required. An array of header values to include in the request.

**note:** HTTP requests created by this function automatically include 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.

## Usage

This example issues an HTTP POST request and outputs the resulting JSON object.

```xml
<script runat="server">
  Platform.Load('Core','1');
  var url = "https://example.com/forms/myForm.html";
  var contentType = "text/xml";
  var payload = "<test>test123</test>";
  var headerNames = ["MyTestHeader1", "MyTestHeader2"];
  var headerValues = ["MyTestValue1", "MyTestValue2"];
  var result = HTTP.Post(url, contentType, payload, headerNames, headerValues);

  Write(result.StatusCode + "<br>");
  Write(result.Response);
</script>
```
