maraujop/requests-oauth — Issue #17: fix for issue #12 breaks GET request with params
Author: joeshaw
Created: 2012-02-24 16:41:47+00:00
State: open

Doing a single GET request passing in `params` when `header_auth` is unset breaks:

session.get("http://www.example.com", params={"foo": "bar"})

This is because `get_normalized_parameters()` only sets `request.data_and_params` if the Content-Type is `application/x-www-form-urlencoded` or `request.data` is a basestring. For most GET requests neither is true: Content-Type is unset and `request.data` is None because there is no body. (Things may work if you pass in the values as `data` because this sends a body, but sending a body with a GET request is considered bad form.)

When `header_auth` is False, `__call__()` replaces the `request.url` with a call to `to_url()`, which iterates over the values in the now-unset `request.data_and_params`. As a result, your parameters are never passed through.