-
Notifications
You must be signed in to change notification settings - Fork 111
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
Allow to specify HTTPoison options directly in config #38
Conversation
using custom options like: follow_redirect or proxy.
3cc1284
to
8649d0d
Compare
From my understanding of I don't think additional global configs are required. Just need additional documentation on how to create a custom middlewares to add in request options |
Additionally, it would be more appropriate to abstract out the Also, I notice that the I'm going to be finishing up #31 today, could you use that as a basis for writing the middlewares for the two options (proxy and follow_redirects)? Another note is that the proxy middleware needs to accept two options, the proxy host and port, and a proxy_auth key as well, as HTTPoison doesn't parse a proxy string in the format of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in my comment, I think we should be reducing the use of global configs.
For the case of Crawly.fetch
, I think what would make it better would be to instead to call relevant functions in RequestsStorageWorker
and DataStorageWorker
to simulate the request moving through the declared middlewares & pipelines
Also, there seems to be a typo for the :follow_redirect
key, it should be without an s.
Hmm... Yeah @Ziinc , it's complicated I agree. I kind of agree with your comments! So to say from my point of view it probably makes sense using middlewares for the case of proxies (where we might want to direct requests via different sources). But maybe I would not want to use them to hardcode the ssl options. What do you think? |
From my understanding of the I don't think merging this PR is necessary, just maybe need to add even more to the docs? |
I think the points raised in :
would be better to tackle, as this PR is not necessary since options can already be set through the request. |
Closing as documentation on how to pass HTTPoison request options has been added into documentation in #31 |
Made in order to address the: #33