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
2
votes
2 answers

Reading Instagram JSON with Ruby Controller and passing to View, using HTTParty gem

I'm trying to learn processing JSON with Ruby. I went through quite a few tutorial but got confused even more, so I try to learn by doing it. Here, I'm trying to get user's data from Instagram and display in my View. I have access to the JSON below…
Designer
  • 1,061
  • 1
  • 12
  • 26
2
votes
2 answers

DEPRECATION: HTTParty will no longer override `response#nil?`. What does this Deprecation warning mean?

This question is probably poorly structured so please bear with me, I'm new at this. I'm trying to build a simple web scraper but every time i run my code i get this warning in terminal. I have tried to follow the link to the github issues hoping i…
Phillip Musiime
  • 167
  • 2
  • 12
2
votes
1 answer

Why is rails not showing my API call results?

I’m completely new to ruby on rails, I’m creating a simple article search application that would use the Guardian API and just display the news titles. I made a simple view, controller and a class that makes calls to external API, but the results…
mbbm9
  • 63
  • 8
2
votes
1 answer

how to deal with pagination when making api request using httparty rubygem

I'm trying to write a plugin for my Jekyll site which writes a sorted JSON response to a data file, but I'm having trouble dealing with the limit of items in the response. The basic response looks like this: { "current_page": 1, "per_page": 50, …
jbowman
  • 380
  • 3
  • 15
2
votes
0 answers

HTTParty to parse HTML

I'm looking for a way to pull specific content off of a web site that is fairly well formed, but not quite perfect xml: title
pedstrom
  • 431
  • 1
  • 6
  • 17
2
votes
1 answer

Httpary: OpenSSL::SSL::SSLError

I been using httparty to communicate with a API for my rails application The problem I'm having was when decided to run it on a different server. we kept getting this error: SSL_connect returned=1 errno=0 state=unknown state: tlsv1 alert protocol…
2
votes
1 answer

HTTParty integer in request headers

I need to POST to an API, which requires a header in the request called "Timestamp", whose value has to be an integer (current time from epoch as an integer). I tried to do this with HTTParty and with Net::HTTP as follows: response =…
Steve Q
  • 395
  • 5
  • 28
2
votes
0 answers

Curl command works, but httparty request gives 403

I have a curl command that makes a POST request, and returns with the correct response: curl --data…
Jon Juan
  • 21
  • 2
2
votes
1 answer

Ruby - no implicit conversion of HTTParty::Response into String exotel api

I'm unable to fetch response or send request to exotel sms api using the provided documentation on exotel rubygem http://www.rubydoc.info/gems/exotel/0.2 The documentations says to fetch response as follows: sms = Exotel::Sms.details(sms_id) But…
Jesse Sravya
  • 121
  • 1
  • 2
  • 9
2
votes
2 answers

HTTParty patch request doesn't work when curl does

In Rails 4.2 I'm using HTTParty to make an API wrapper for version 3 of SendGrid's API. This is what it looks like: class SendGridV3 include HTTParty debug_output $stdout base_uri 'https://api.sendgrid.com/v3' format :json headers…
Toby 1 Kenobi
  • 4,717
  • 2
  • 29
  • 43
2
votes
1 answer

HTTParty won't load in Ruby file

I am trying to run a webscraper and when I execute the file I get the following error /home/luis/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- httparty (LoadError) from…
Luis Mejia
  • 87
  • 1
  • 11
2
votes
2 answers

How to get 302 redirect location in Rails? (have tried HTTParty, Net/Http and RedirectFollower)

Hello i am trying to get Facebook user's album's cover picture. as it's said in the API page, it returns "An HTTP 302 with the URL of the album's cover picture" when getting: http…
Charlie Banalie
  • 198
  • 1
  • 11
2
votes
0 answers

How to unset/delete cookies using HTTPARTY

I'm having a problem where cookies are being saved between multiple gets, is there not a way to clear them/delete them/unset them inbetween each get? So far I've tried sending "Cookie" => "" with the header, self.class.cookies({}) before get,…
MikaelaL
  • 41
  • 2
2
votes
1 answer

How do I search a json array that i am getting from a url and using httparty to parse?

This is the url: https://meta.discourse.org/c/bug.json I recovered the user_id of someone who started a topic. Now I need to use that user_id, which I have saved in an instance variable @id = 21509 to search the users array for the object whose id…
Timmy Von Heiss
  • 2,160
  • 17
  • 39
2
votes
3 answers

Rails: Net::OpenTimeout execution expired with HTTParty

My app is supposed to get JSON data from an external URL. It was working just fine until this morning. I see this error message: Net::OpenTimeout in CommandesController#generate execution expired I have changed NOTHING and I can still access the…
JulienP
  • 63
  • 1
  • 6