You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'accept' header is set if the 'content-type' header is a JSON or XML type which causes unexpected behavior if creating a request like here, where the underlying spec requires a JSON type but the server is not expected to return the same type, or any type, back.
Is there reasoning to set the 'accept' header automatically if it is a JSON or XML type? It seems like the auto-setting of the accept header should be toggle-able by client or the 'accept' header should only auto-set for basic MIME types.
The text was updated successfully, but these errors were encountered:
@Dylmay Typically, resty understands the JSON and XML marshal/unmarshals. Hence, it notifies the server via the Accept header if it sees content type JSON/XML and the Accept header is empty.
@Dylmay Typically, resty understands the JSON and XML marshal/unmarshals. Hence, it notifies the server via the Accept header if it sees content type JSON/XML and the Accept header is empty.
So, if the user sets the Accept header explicitly, then Resty will not do any action.
I have encountered the same issue as well. In principle, resty should not set any unexpected header for the user. Users are supposed to set headers themselves, and in some cases, it is necessary not to set certain headers. In the current mode, if users want to avoid setting the User-Agent or Accept header, there is no way to do so.
The 'accept' header is set if the 'content-type' header is a JSON or XML type which causes unexpected behavior if creating a request like here, where the underlying spec requires a JSON type but the server is not expected to return the same type, or any type, back.
Is there reasoning to set the 'accept' header automatically if it is a JSON or XML type? It seems like the auto-setting of the accept header should be toggle-able by client or the 'accept' header should only auto-set for basic MIME types.
The text was updated successfully, but these errors were encountered: