samgiles / slumber

A library that makes consuming a RESTful API easier and more convenient
http://slumber.readthedocs.org
BSD 2-Clause "Simplified" License
595 stars 120 forks source link

format is not taken into account #131

Open kspeeckaert opened 8 years ago

kspeeckaert commented 8 years ago

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:

amureki commented 6 years ago

@kspeeckaert greetings! We've made a fork and PR fixing this (but no tests covering this yet). But I don't know if this package is still maintained.

@samgiles can we reach you out?

Upd.: added test (I am not sure about styling though)