Questions tagged [httparty]

HTTParty is a Ruby gem written by John Nunemaker focused on the consumption of web services and APIs.

HTTParty is a Ruby gem written by John Nunemaker focused on the consumption of web services and APIs. It boasts a very readable DSL and out-of-the-box support for JSON, HTML and XML.

For more information refer to: It's an HTTParty and Everyone Is Invited!

621 questions
7
votes
2 answers

Ruby httparty post request

I have working php code
user8338151
  • 103
  • 1
  • 1
  • 9
7
votes
1 answer

Can someone provide an example for how to post XML using HTTParty and Ruby on Rails?

I need to post some xml to a webservice and I'm trying to use HTTParty. Can someone provide an example as to how I go about doing so? Here is the format of the XML I need to post:
Mike G
  • 379
  • 5
  • 11
7
votes
6 answers

Ruby httparty Load Error

I am trying to load (require) the httparty gem into a Ruby file but keep getting an error and am unsuccessful. Below is the error…
Neil Ricci
  • 159
  • 1
  • 1
  • 9
7
votes
1 answer

Generate XML dynamically and post it to a web service in Rails

I am currently developing a Rails app in which I need to dynamically send XML request to an external web service. I've never done this before and I a bit lost. More precisely I need to send requests to my logistic partner when the status of an order…
ClemDoum
  • 77
  • 1
  • 6
7
votes
7 answers

HTTParty with Proxy

I am on heroku trying to access an API that requires my apps ip to be whitelisted. So, I used the heroku add-on proximo to get host/ip for the api's whitelist. A quick test I set up to test connectivity using HTTParty is failing. class FakeRequest …
RidingRails
  • 782
  • 3
  • 7
  • 21
6
votes
1 answer

Execution expired exception crashing Ruby thread, but Timeout::Error is handled

Can anyone explain why I might see this stack (caused by an HTTParty::post request) when the call to the method looks like this: begin response = HTTParty::post(url, options) rescue logger.warn("Could not post to #{url}") rescue…
esilver
  • 27,713
  • 23
  • 122
  • 168
6
votes
1 answer

Memory issues with HTTParty and download large files

Is this going to cause memory issues with Ruby. I know Open-URI writes to a TempFile if the size goes over 10KB. But will HTTParty try and save the whole PDF to memory before it writes to TempFile? src =…
maletor
  • 7,072
  • 7
  • 42
  • 63
6
votes
1 answer

send json object with httparty

I'm trying to implement the in App purchase from within my iPhone app. To verify the receipt I need to send a json object to the iTunes server. Im trying to do this with the httparty plugin: require 'httparty' class ItunesVerification include…
Markus
  • 3,948
  • 8
  • 48
  • 64
6
votes
4 answers

Ruby HTTParty - get the redirected URL

I am trying to send an HTTP request using HTTParty with some parameters, Eg: GET URL: http://example1.com?a=123&b=456 response_to_get = HTTParty.get('http://example1.com?a=123&b=456') The redirect_url for this particular request is…
6
votes
2 answers

Rails how to follow redirect in HTTParty GET request

I am using httparty to send a get request and then trying to follow the redirect: get 'https://accounts.google.com/o/oauth2/auth' how can i follow the redirect using HTTParty? sorry if this have been asked before, but i could not find the answer…
Wahtever
  • 3,597
  • 10
  • 44
  • 79
6
votes
2 answers

How do I send an empty array through a PUT request via HTTParty?

I have a Photo class that has a "name" attribute and a "tags" attribute. My goal is to implemented an update function in Rails that replaces the photo's tags with whatever was inputted. For example, if I try to PUT a JSON object that has "tags" set…
Donald Huh
  • 61
  • 2
6
votes
2 answers

How to set the port in HTTParty

I read that HTTParty uses SSL if the port is set to 443, but I don't see how to set the port. Can someone clarify this for me?
JellicleCat
  • 28,480
  • 24
  • 109
  • 162
6
votes
2 answers

Content Type troubles with HTTParty against Rails

require 'HTTParty' require 'json' @payload ={ "email" => "phil@gmail.com", "token" => "mytokenstuff", "content" => "here is some content", "notification_type" => "1", "name" => "here is a name", "auto_action" => "true" …
phil swenson
  • 8,564
  • 20
  • 74
  • 99
5
votes
1 answer

HTTParty POST is sending a GET

I'm hitting Github's v3 rest api, I'm making a POST request attempting to create a comment on a test PR. I'm getting back a 200 response, and upon inspecting the request, it was sent as a GET, not a POST: response = HTTParty.post( …
NoobException
  • 616
  • 9
  • 20
5
votes
2 answers

HTTParty Digest Auth

Can anyone provide an example of using HTTParty using digest auth? I can't find examples on the net and was hoping someone could provide some help. Thanks.
BlakeWilliams
  • 940
  • 12
  • 20
1 2
3
41 42