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
4
votes
1 answer

HTTPS and HTTParty - Timeout and EOF

I'm trying to post something to an HTTPS resource, but it seems it doesn't work. My code look something like this: require 'httparty' class MyClass include HTTParty base_uri "https://mydomain.com:8085/search" basic_auth 'admin',…
ferparra
  • 135
  • 2
  • 9
3
votes
1 answer

Sending a post query sent via HTTParty

I'm working with the Buffer App API with HTTParty to try and add posts via the /updates/create method, but the API seems to ignore my "text" parameter and throws up an error. If I do it via cURL on the command line it works perfectly. Here's my…
Pezholio
  • 2,439
  • 5
  • 27
  • 41
3
votes
1 answer

Python equivalent for HTTParty

I have created an API like project in Ruby on rails using HTTParty gem.Now my boss want me to do the same in Python and I don't know python.So I would like to know is there any equalent gem or default function in Python to generate http requests so…
shajin
  • 3,214
  • 5
  • 38
  • 53
3
votes
1 answer

How do I set HTTParty configuration parameters on my class dynamically?

The simple_client.rb file below works perfectly fine against my emulation cas server; however, the casport.rb file (main file of oa-casport OmniAuth strategy) is not setting or passing the headers / format properly. It needs to be dynamically…
stevenhaddox
  • 1,185
  • 1
  • 13
  • 22
3
votes
0 answers

How to send HTTParty POST call with body values as form-data

I have a RoR application from where I need to call a 3rd party API with several different calls. GET requests work fine with both Postman and HTTParty, but I can't get POST to work with latter. In Postman, I have a default request with basic auth,…
bmes
  • 61
  • 2
  • 8
3
votes
1 answer

HTTParty POST call returning invalid JSON

I am looking to post to an API with my email address, but I cannot get a workable response. When I simply cURL the API in the terminal, the data is returned as expected. @omnics2 =…
sulleh
  • 321
  • 5
  • 14
3
votes
1 answer

Passing cookies with HTTParty

I'm trying to log in a user with HTTParty into a Rails application. The idea is to send a POST request and get a session cookie with it, then send a GET request with this cookie and log in successfully: POST request HTTParty.post('url/login/',…
Dende
  • 545
  • 6
  • 19
3
votes
1 answer

How do I interact with an external search API in Rails5 using the HTTParty gem?

How can I create an app in Rails that will let me input search parameters, which are then passed to an external API to perform the search, and then display those results in my app. I'm trying to use HTTParty to achieve this but I'm a bit lost. I've…
user10410465
3
votes
1 answer

Trying to get list of friends from twitter using httparty(ruby)

I am trying to get the list of specific user`s friends from twitter. This is my code - require 'rubygems' require 'httparty' class TwitterData include HTTParty base_uri 'http://api.twitter.com/1/' default_params :output => 'json' format…
Yosi
  • 2,936
  • 7
  • 39
  • 64
3
votes
4 answers

Unescaping characters in a string with Ruby

Given a string in the following format (the Posterous API returns posts in this format): s="\\u003Cp\\u003E" How can I convert it to the actual ascii characters such that s="

"? On OSX, I successfully used Iconv.iconv('ascii', 'java', s) but once…

hiwaylon
  • 465
  • 7
  • 15
3
votes
1 answer

Fail to download a remote https svg file but embed inside is good

I have a https link, embedded into , everything is good. Such as https://jsfiddle.net/Lbhhtt6n/. However, if you try to download link directly such as directly open it with browser with link…
new2cpp
  • 3,311
  • 5
  • 28
  • 39
3
votes
1 answer

Can I consume a SOAP web service using httparty or weary?

I am currently working on a ROR project that needs to consume some SOAP based web services. What I know about consuming web services borders on the 'dangerous'. The example that the site provides is using asp with XMLHTTP to send what appears to be…
nexar
  • 11,126
  • 3
  • 29
  • 32
3
votes
1 answer

Accessing the filename in an HTTParty response?

I am trying to parse the response from an api that has content type text/csv in a Ruby application. I am making the request using the HTTParty library. I know the filename is typically stored in the response headers under Content-Disposition, but…
Quinn Stearns
  • 162
  • 1
  • 8
3
votes
2 answers

"OpenURI::HTTPError: 401 Unauthorized" with Rails, HTTParty, and Paperclip

I'm using HTTParty to get data from the Eventbrite API. response = HTTParty.get("https://www.eventbriteapi.com/v3/events/search?token=#{Figaro.env.eventbrite_oauth_token}") I am trying to save an Event attachment to my object. (I'm using…
Jackson Cunningham
  • 4,973
  • 3
  • 30
  • 80
3
votes
1 answer

"Hostname does not match the server certificate" error in Mechanize and HTTParty

Occationally, when I visit a website with HTTParty or Mechanize, I get this error: hostname "www.example.com" does not match the server certificate I can see that there is a workaround if you use the open method, but I'm not sure how to leverage…
Cjoerg
  • 1,271
  • 3
  • 21
  • 63