---
schema_version: "1"
id: 896121ef6cce590133983a71a43965e6f8910d81772a1cb13f4e9783d9779e63
title: HTTP.Get()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_httpGet.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_httpGet.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8d3df381e0b348b935cb0c813793f7e1bff02d86bdd191fd06c5952d2ed9ba79
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# HTTP.Get()

Performs an HTTP GET by using the provided name and value pairs against the passed URL, and it returns a JSON object that contains a status value and the HTTP response. You can include multiple pairs of header names and values. This function only works with HTTP on port 80 and HTTPS on port 443.

## Syntax

```
HTTP.Get(1, 2, 3)
```

## Properties

The `HTTP.Get()` function has the properties listed in this table.

| Ordinal | Type   | Description                                             |
| ------- | ------ | ------------------------------------------------------- |
| `1`     | String | Required. The destination URL for the HTTP GET request. |
| `2`     | Array  | An array of header names to include in the request.     |
| `3`     | Array  | An array of header values to include in the request.    |

<!--[BM 2/13/25] This section doesn't seem relevant to the function. Commenting it out in case we need to restore it later.
Marketing Cloud Engagement recognizes any character set returned in the HTTP headers by setting the appropriate `Content-Type` header. For example, you can use a UTF-8 encoded HTML file by including `Content-Type: text/html; charset=utf-8` in the header. If you don’t specify the encoding in the header, data is returned using the WindowsCodePage 1252 character set. To change the default content type, contact Salesforce Customer Support.
-->

## Usage

This sample code performs an HTTP GET and outputs the response object.

```js
<script runat="server">
  Platform.Load('Core','1');

  var url = "https://example.com/forms/myForm.html";
  var headerNames = ["MyTestHeader1", "MyTestHeader2"];
  var headerValues = ["MyTestValue1", "MyTestValue2"];

  try {
    var response = HTTP.Get(url, headerNames, headerValues);
    Write(Stringify(response));
  } catch(e) {
    Write(Stringify(e));
  }
</script>
```

The response is a JSON object that contains a numeric status value and the response body of the GET request.

```json
{
  "Status": 0,
  "Content": "{
    \"args\": {},
    \"headers\": {
      \"Host\": \"example.com\",
      \"Mytestheader1\": \"MyTestValue1\",
      \"Mytestheader2\": \"MyTestValue2\",
      \"X-Amzn-Trace-Id\": \"Root=1-67ae4eb9-4b57ee616f927d773ff4f5be\"
    },
    \"origin\": \"203.0.113.1\",
    \"url\": \"https://example.com/forms/myForm.html\"
  }"
}
```

## See Also

- [Platform.Function.HTTPGet()](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformContentSyndicationHTTPGet.md)
- [Script.Util.HttpGet()](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformContentSyndicationScriptUtilHttpGet.md)
