SQS REST requests include headers which contain basic information about the request. The table below describes the required and optional headers for SQS REST requests.
| Header Name | Description | Required |
|---|---|---|
| The information required for request authentication. See About the Authorization Header for details about the format. | Yes |
| The version of the SQS API. For example: | Yes |
| Length of the message (without the headers) according to RFC 2616. Condition: Required if the request body itself contains information (most toolkits add this header automatically). | Conditional |
| The base64 encoded 128-bit MD5 digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the decoded data is the same data that was originally sent. You want to use this header if you're interested in ensuring data integrity. Note that we ignore the MD5 for the purposes of our signature validation. See Authenticating REST Requests for more information about REST request authentication. | No |
| The content type of the resource. Example: | Yes |
| The date used to create the signature contained in the | Yes |
| The host being requested. The value must be Condition: Required for HTTP 1.1 (most toolkits add this header automatically) | Conditional |
The authorization header is a string that follows this format:
AWS <AWSAccessKeyId>:<Signature>
Note that there is a space after "AWS".
To calculate the value for <Signature>:
Create a string with the format:
HTTP-METHOD>\n<content-MD5>\n<ContentType>\n<date>\n<path>
For example:
PUT\n\ntext/plain\nThu, 01 Jun 2006 12:12:23 PDT\n/
Use your AWS Secret Access Key to create an HMAC-SHA1 hash of the string and use that as the value of <Signature>.
![]() | Important |
|---|---|
Notice that there is no new line at the end of the string. This is a common mistake that causes authentication failure. |