httparty
httparty copied to clipboard
Please specify in documentation to convert body in json
I've spent one hour figuring out how to proper send a POST request, ended up on https://stackoverflow.com/questions/7455744/post-json-to-api-using-rails-and-httparty which helped me a lot in adding .to_json to the body hash
@result = HTTParty.post(@urlstring_to_post.to_str, :body => { :subject => 'This is the screen name', :issue_type => 'Application Problem', :status => 'Open', :priority => 'Normal', :description => 'This is the description for the problem' }.to_json, :headers => { 'Content-Type' => 'application/json' } )
This is probably common enough that it could be detailed in the docs. @jnunemaker could you review https://github.com/jnunemaker/httparty/pull/765 please?
Merged the documentation update for this.