requests-oauthlib
requests-oauthlib copied to clipboard
Oauth1 with x-www-form-urlencoded fails for GET/HEAD method
oauthlib will produce an error if a body is sent with a GET/HEAD method.
elif http_method.upper() in ('GET', 'HEAD') and has_params:
raise ValueError('GET/HEAD requests should not include body.')
If our content type is form-urlencoded then we force an empty body.
if is_form_encoded:
r.headers['Content-Type'] = CONTENT_TYPE_FORM_URLENCODED
r.url, headers, r.body = self.client.sign(
unicode(r.url), unicode(r.method), r.body or '', r.headers)
The libraries conflict and thus will fail if the method is GET/HEAD.
Did you find a solution to this?