1

Is there a way to make a presigned aws upload URL return a json response if there is a error rather then a xml response.

Currently it returns something like the following if the url is expired.

<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>AccessDenied</Code>
    <Message>Request has expired</Message>
    <X-Amz-Expires>900</X-Amz-Expires>
    <Expires>2020-02-06T20:13:39Z</Expires>
    <ServerTime>2020-02-06T20:26:33Z</ServerTime>
    <RequestId>2A23445454569</RequestId>
    <HostId>oi3j4o5ij346?3464556756567/5675685745yfghr5y4/456345345=</HostId>
</Error>

Would be nice if this was a json response instead.

1 Answer 1

1

No, there is no way. It is not specific to pre-signed-url endpoints but S3 doesn't return json but xml.

According to Error Responses documentation of s3;


REST Error Responses

When an error occurs, the header information contains the following:

  • Content-Type: application/xml
  • An appropriate 3xx, 4xx, or 5xx HTTP status code

Also you may check list of available methods from here, as it can be seen they are all XML.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.