The REST Error Response

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

  • An XML error document as the response body

  • Content-Type: application/xml

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

Following is an example of a REST Error Response.

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>NoSuchKey</Code>
  <Message>The resource you requested does not exist</Message>
  <Resource>/mybucket/myfoto.jpg</Resource> 
  <RequestId>4442587FB7D0A2F9</RequestId>
</Error>

For more information about Amazon S3 errors, see Working with Errors.

Following are response headers returned by all operations: