Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Result of 'response' hook is stored in session.response and not returned #1106

Closed
johtso opened this Issue Jan 17, 2013 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

johtso commented Jan 17, 2013

https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L298

Should the result of dispatch_hook actually be returned? Seems to make no sense to store it as a property of the session object.

The documentation states:

"If the callback function returns a value, it is assumed that it is to replace the data that was passed in. If the function doesn’t return anything, nothing else is effected."

Another thing I've noticed, and don't quite understand, is that hooks are executed by the adapter as well, and that hooks are not preserved when the PreparedRequest is being generated.

Contributor

johtso commented Jan 17, 2013

This pull request is very relevant: kennethreitz#1099

@johtso johtso referenced this issue in kennethreitz/grequests Jan 17, 2013

Merged

Requests v1.x.x compatibility. Fixes #28 #29 #31

Owner

sigmavirus24 commented Jan 17, 2013

I'll fix this in a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment