requests icon indicating copy to clipboard operation
requests copied to clipboard

data arg submitted to 'patch' method is ignored

Open sergedomk opened this issue 15 years ago • 4 comments

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)

sergedomk avatar Sep 09 '11 20:09 sergedomk

Yikes, thanks for the fix.

Much appreciated :)

kennethreitz avatar Sep 14 '11 12:09 kennethreitz

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.

mrtazz avatar Oct 20 '11 22:10 mrtazz

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.

sergedomk avatar Oct 21 '11 00:10 sergedomk

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.

kennethreitz avatar Oct 21 '11 01:10 kennethreitz