Skip to content
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

Request: Provide a way to get a Request object before it's sent to #handle_request #85

Closed
totallymike opened this issue Nov 6, 2014 · 2 comments

Comments

@totallymike
Copy link
Contributor

We're using Patron in a project, and we need to add a few custom headers based on the state of, say, query params and certain other headers. Since Patron::Session#request already builds a Patron::Request object that has so much stuff I need (like a canonical form of the query params), I'd love to have access to that object prior to sending it to handle_request.

Would you be open to a PR that provides such a mechanism?

Pretty much what I'd do is yank out the code that exists in Patron::Session#request, put it in a method called, say, #build_request, then call that method in #request. Then I can get the request and pass it on to #handle_request later if I want to.

@toland
Copy link
Owner

toland commented Nov 6, 2014

This sounds fine to me.

@julik
Copy link
Collaborator

julik commented Apr 12, 2016

This has been resolved in a PR.

@julik julik closed this as completed Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants