-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running prepare_headers on PreparedRequest break it #4833
Comments
The error occurs while |
@mlubinmow what do you think should be happening here? I'm not convinced this is a bug in Requests but rather in using undocumented methods. Specifically http://docs.python-requests.org/en/master/user/advanced/?highlight=PreparedRequest#prepared-requests tells you how you're expected to interact with PreparedRequests and makes no guarantees about the |
@sigmavirus24 I disagree, function is listed in Devs interface and is inconsistent, as it works for GET request. I would expect it to.. just work ;) As mentioned in an issue. http://docs.python-requests.org/en/master/api/#lower-lower-level-classes |
@mlubimow just because something is included in auto-generated documentation doesn't mean it just magically works as you expect it to. |
To be clearer, the documentation I linked to explains how to actually work with the prepared request flow. If something happens to work in one case when you do something the system wasn't designed for, it doesn't mean it must work in a different case. |
After calling prepare() on a request, PreparedRequest object is returned. If its a PATCH request (GET is working as expected), and prepare_headers is called, it's not possible to send this request.
Expected Result
Headers should be added to a prepared request and it should be possible to send it later.
Actual Result
An exception is thrown:
Reproduction Steps
System Information
The text was updated successfully, but these errors were encountered: