-
Notifications
You must be signed in to change notification settings - Fork 964
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 format #30
Comments
Makes sense to me but I'd like to get more feedback from the community before committing to it. |
Cool. Le me know if I can help. |
I'd love to see a patch/gist demonstrating a backwards compatible response object which inherits (or simply quacks) like a Net:HTTTP response. |
Oops, sorry...that comment was meant for another issue. Anyways, patches are always welcome! |
Hey guys, I ran into this in a project I'm doing and made a quick fix: It's not very elegant, but it does the job for me. I made the patch in my project as you can see, if someone would like me to make a fork and commit it there send me a message and I will :) (edit: made a revision to the patch (how meta) obviously nil isn't a Hash either :P) |
Is anyone making HTTParty speak the request format? For instance, build a XML string when requesting XML, etc? |
I'm not working on this but not against merging the patch. Are we suggesting that setting the format automatically sets the accept header and converts the body string to XML/JSON? I'm okay with setting the accept header but converting the body seems a bit much. |
The majority (all?) of the APIs I've encountered expect you to speak what you request. Only makes sense to me to do that. I've resorted to encoding my own XML sending over the wire for now...but +1 for the idea from me. At the very least perhaps offer an option to speak what you request? |
Did this ever get implemented? I want to send json objects to a api but i cant figure out how to do it, is this possible with the lastest version of HTTParty? |
Hey @kalasjocke I've submitted a pull request for my patch, #96 or you can just use my fork: https://github.com/d-snp/httparty/tree/request_content_type It was a long time ago that I used this so I'm not sure if this fixes all problems. |
Alright, nice work @d-snp! Maybe i will use your fork in my project then, thanks! |
Would it make sense for :format => :xxxx or header 'content-type' => xxxx to also set the format of the request being sent into xxxx format.
So for exmaple, if :format => :json, the request sent would be formatted in json.
To avoid conflict, a new option might be create. Something like :request_format.
The text was updated successfully, but these errors were encountered: