data arg submitted to 'patch' method is ignored
The data parameter passed to the 'patch' method in api.py is not being included in the parameter list passed to the 'request' method. The following change shown below fixes the issue.
In api.py:
def patch(url, data='', **kwargs):
"""Sends a PATCH request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
:param **kwargs: Optional arguments that ``request`` takes.
"""
- return request('patch', url, **kwargs)
+ return request('patch', url, data=data, **kwargs)
Yikes, thanks for the fix.
Much appreciated :)
I think this bug has regressed into the codebase again. I have a failing unit test for this in https://github.com/kennethreitz/requests/pull/215 and was wondering how it got there.
You are right. Looking through the commit history, I'm not seeing the commit for that issue. Seems it might have gotten inadvertently wiped.
On 10/20/2011 03:57 PM, Daniel Schauenberg wrote:
I think this bug has regressed into the codebase again. I have a failing unit test for this in https://github.com/kennethreitz/requests/pull/215 and was wondering how it got there.
Sorry about the bug, guys. The rewrite to urllib3 was previously taking place in the develop branch, but was taking longer than expected (was blocking releases), so I had to back it out into a feature branch. The codebase is in a good state again, and pull requests that were merged into that branch are being backported into new releases.