maraujop/requests-oauth — Issue #12: No support for string data
Author: immunda
Created: 2012-02-11 23:51:53+00:00
State: open

This is what I think gldnspud's pull request was in reference to.

If you provide a string instead of a dict as the data arg to the request, then 'get_normalized_parameters()' will cause an exception when it tries to access 'request.data.items()'; which is a string not a dict.

This behaviour is supported by the requests library: "There are many times that you want to send data that is not form-encoded. If you pass in a string instead of a dict, that data will be posted directly".

I'm not sure on the best solution to this - I'm using a solution similar to gldnspud's, but am checking the whether request.data is a basestring instance rather than checking the "Content-Type" header explicitly.

Thanks, Phil.