-
Notifications
You must be signed in to change notification settings - Fork 321
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
Flatten :form hash? #2
Comments
:form is there to indicate what you pass to it should be sent encoded as "application/x-www-form-urlencoded", and as far as HTTP is concerned, it is sending a form. This is what Net::HTTP originally tried to disambiguate it with a separate method, #post_form. You can post other things besides forms. For example you should be able to post JSON with:
This would encode the Ruby hash as a JSON object and post it with the type "application/json" Without toplevel options, how do you disambiguate how the Ruby object should be encoded? |
Ah ha, okay -- so I was wrong about it not indicating anything (should have looked at the code first...) -- I guess I assumed that was explicitly set in the headers at the user's discretion -- nice to see that it's automatic. I like the library even more now. This should be in the ruby 2 standard library :) |
Hi -- I love the library.
What do you think about putting the POST vars hash at the top level instead of pointing at it with
:form
? There's nothing else in that options hash anyway, and also the word "form" kind of bothers me, since that's device-specific and in this case it's clearly not a form :)The text was updated successfully, but these errors were encountered: