When an error occurs, the header contains the following information:
Content-Type: application/xml
HTTP status code (4xx or 5xx)
Information about an error is also available in the body or response. The following example shows the structure of response elements that are common to all REST error responses.
<?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 a further information about REST error response elements, see Amazon's official S3 REST API Error Response documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html).