REST Responses

Amazon CloudFront responses are just standard HTTP responses. Some of the CloudFront actions return special information specific to CloudFront in the form of an HTTP header or XML in the body of the response. The specific details are covered in the API reference topic for the particular action.

Request ID

Each response contains a request ID that you can use if you need to troubleshoot a request with AWS. The ID is contained in an HTTP header called x-amz-request-id. An example of a request ID is 647cd254-e0d1-44a9-af61-1d6d86ea6b77.

Example Response

The following example shows the response when creating a distribution.

201 Created
Location: https://cloudfront.amazonaws.com/2009-12-01/distribution/EDFDVBD632BHDS5
x-amz-request-id: request_id


<?xml version="1.0" encoding="UTF-8"?>
<Distribution xmlns="http://cloudfront.amazonaws.com/doc/2009-12-01/">
    <Id>EDFDVBD632BHDS5</Id>
    <Status>InProgress</Status>
    <LastModifiedTime>2009-11-19T19:37:58Z</LastModifiedTime>
    <DomainName>d604721fxaaqy9.cloudfront.net</DomainName>
    <DistributionConfig>
      <Origin>mybucket.s3.amazonaws.com</Origin>
      <CallerReference>20091130090000</CallerReference>
      <Comment>My comments</Comment>
      <Enabled>true</Enabled>
    </DistributionConfig>
</Distribution>

Error Responses

If a REST request results in an error, the HTTP reply has:

  • An XML error document as the response body

  • Content-Type header: application/xml

  • An appropriate 3xx, 4xx, or 5xx HTTP status code

Following is an example of the XML error document in a REST error response.

<ErrorResponse xmlns="http://cloudfront.amazonaws.com/doc/2009-12-01/">
   <Error>
      <Type>Sender</Type>
      <Code>InvalidURI</Code>
      <Message>Could not parse the specified URI.</Message>
   </Error>
   <RequestId>410c2a4b-e435-49c9-8382-3770d80d7d4c</RequestId>
</ErrorResponse>

Related Topics