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
Resource.__call__() has an argument format, that should be used to get the correct content type and add it to the headers when performing the request.
If you look at the code for Resource._request(), it set the accept header to the correct content type by executing serializer.get_content_type(). However, the value passed to format (which is stored in self._store['format']), is not passed to the get_content_type() function, which causes get_serializer() to return the default serializer. This in turn will cause the accept header to be set to the content type of the default serializer.
TL;DR:
The format option isn't used
The default format specified when creating the API object will always be used to set the accept header (defaults to JSON).
The text was updated successfully, but these errors were encountered:
amureki
added a commit
to thermondo/slumber
that referenced
this issue
Aug 22, 2018
Resource.__call__()
has an argumentformat
, that should be used to get the correct content type and add it to the headers when performing the request.If you look at the code for
Resource._request()
, it set theaccept
header to the correct content type by executingserializer.get_content_type()
. However, the value passed toformat
(which is stored inself._store['format']
), is not passed to theget_content_type()
function, which causesget_serializer()
to return the default serializer. This in turn will cause theaccept
header to be set to the content type of the default serializer.TL;DR:
format
option isn't usedaccept
header (defaults to JSON).The text was updated successfully, but these errors were encountered: