As all you know (else follow this question) the requesting Accept header allows client to specify the expected MIME types for response content.

But my case is:

  • client indicates an Accept of type image/*
  • server process the request but encounters an error, so it has to return other status code different from 200 OK, and a JSON with information about error, so Content-type: application/json is the response

So I have a few questions:

Also I got to the RFC 7807 but I don't see anyway how will solve, because the returned Content-type still not matching the requested ones.

  • Most URLs only offer a single type of content regardless of the accept request headers. I'd imagine that if a limited accept is sent, it isn't honored by most servers. On the other hand, most browsers send a star as the last part of the accept (they will accept anything). Which client is so limited? Jun 26 '18 at 9:46
  • Client is not a browser, but would be REST client developed by others. I don't know how limited can be or auto-magically-rules would apply. I would like also to avoid force the client to add too much code.
    – lucasvc
    Jun 26 '18 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.