---
schema_version: "1"
id: 98f2694423cec4e843b965d700b454b0c940118250b22579eec206c26255066a
title: Send REST Requests with cURL
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/api-rest/guides/intro/intro-curl.md
canonical_url: https://developer.salesforce.com/docs/platform/api-rest/guide/intro-curl.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: da8aad0c776f91ada3689c22c1577fabe807eca2ef5bbc0a868f0dd51a2c366c
products:
  - REST API Developer Guide
  - Platform Developer Content
---

# Send REST Requests with cURL

The examples in this guide use the cURL tool to send HTTP requests that access, create, and manipulate resources in Salesforce. If you use a different tool to send requests, you can use the same elements from the cURL examples to send requests.

cURL is pre-installed on many Linux and macOS systems. Windows users can download a version at [curl.haxx.se/](http://curl.haxx.se/). When using HTTPS on Windows, ensure that your system meets the cURL requirements for SSL.

**note:** cURL is an open-source tool and isn’t supported by Salesforce.

## Attaching Request Bodies

Many examples include request bodies—JSON or XML files that contain data for the request. When using cURL, save these files to your local system and attach them to the request using the —data-binary or -d option.

This example attaches the new-account.json file.

```nolang
curl https://MyDomainName.my.salesforce.com/services/data/v/sobjects/Account/ -H "Authorization: Bearer access-token" -H “Content-Type: application/json” —data-binary @new-account.json -X POST
```

## Handling Exclamation Marks in Access Tokens

When you run cURL examples, you can get an error on macOS and Linux systems due to the presence of the exclamation mark (!) special character in OAuth access tokens. To avoid getting this error, either escape the exclamation mark or use single quotes.

To escape the exclamation mark in the access token, insert a backslash before it (\\!) when the access token is enclosed within double quotes. For example, the access token string in this cURL command has the exclamation mark (!) escaped.

```nolang
curl https://MyDomainName.my.salesforce.com/services/data/v68.0/ -H "Authorization: Bearer 00DE0X0A0M0PeLE\!AQcAQH0dMHEXAMPLEzmpkb58urFRkgeBGsxL_QJWwYMfAbUeeG7c1EXAMPLEDUkWe6H34r1AAwOR8B8fLEz6nEXAMPLE"
```

Or, you can enclose the access token within single quotes.

```nolang
curl https://MyDomainName.my.salesforce.com/services/data/v/ -H 'Authorization: Bearer 00DE0X0A0M0PeLE!AQcAQH0dMHEXAMPLEzmpkb58urFRkgeBGsxL_QJWwYMfAbUeeG7c1EXAMPLEDUkWe6H34r1AAwOR8B8fLEz6nEXAMPLE'
```

**See Also**  


-   [Setting Up Your Java Developer Environment](https://developer.salesforce.com/docs/atlas.en-us.salesforce_developer_environment_tipsheet.meta/salesforce_developer_environment_tipsheet/salesforce_developer_environment_overview.htm)

