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

Net::HTTP.get_response can receive URI as string #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kyanagi
Copy link

@kyanagi kyanagi commented May 1, 2021

We need to pass a URI object to Net::HTTP.get_response (or Net::HTTP.get).

Net::HTTP.get_response(URI('http://www.example.com/index.html'))

With this patch, these methods can receive a URI-string.

Net::HTTP.get_response('http://www.example.com/index.html')

@k0kubun
Copy link
Member

k0kubun commented May 1, 2021

For consistency, supporting the same thing for Net::HTTP.post as well might be useful.

@kyanagi kyanagi force-pushed the http_get_response_with_uri_string branch from c639473 to 7a4dc8d Compare May 1, 2021 11:40
@kyanagi
Copy link
Author

kyanagi commented May 1, 2021

@k0kubun
Thank you for your suggestion.
I added the same support for Net::HTTP.post and Net::HTTP.post_form.

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

Successfully merging this pull request may close these issues.

2 participants