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
0
votes
3 answers

How do I convert a curl command with output option to httparty?

I am trying to convert this: curl -k -v -X GET -H "Accept: application/pdf" https://username:password@rest.click2mail.com/v1/mailingBuilders/456/proofs/1 -o myProof for httparty. Here's my code: @auth = {:username => 'test', :password =>…
Bolo
  • 2,668
  • 4
  • 27
  • 34
0
votes
1 answer

After posting some data using httparty, how can I access the posted values in controller?

I have done a posting using httparty. E.g. options={ :foo => '123' :bar => 'second', :baz => 'last thing' } HTTParty.post("localhost/tests" , options) How can I retrieve options parameters in my remote app controller: E.g. #post /tests def…
Sara
  • 2,417
  • 7
  • 35
  • 52
0
votes
1 answer

Anyone who can suggest some good references for Httparty?

Hey I am new to Httparty. I can fetch data but have problem posting using Httparty. Anyone who can suggest some good references for that? Thanks a bunch.
Sara
  • 2,417
  • 7
  • 35
  • 52
0
votes
1 answer

Sending Form data to remote rails application using Httparty

I am new to Httparty. I have a simple rails application with its default methods, new, create for creating a new Model object. So basically if you consider the article controller as an example. First new method instantiates the Model by Model.new…
Sara
  • 2,417
  • 7
  • 35
  • 52
-1
votes
3 answers

Case conditional in ruby doesn't enter in when

My code when executed it's not entering in the when loop inside the case conditional. What I wanted is to sen two different GET requests based on the *args of the function. So I can validate the errors when I don't send one of the parameters in the…
-1
votes
1 answer

A lot of warnings after require 'Time'

When i import Time and HTTParty i got these warnings: C:/Ruby27-x64/lib/ruby/2.7.0/time.rb:34: warning: already initialized constant Class::ZoneOffset C:/Ruby27-x64/lib/ruby/2.7.0/Time.rb:34: warning: previous definition of ZoneOffset was…
André Kuljis
  • 90
  • 1
  • 9
-1
votes
1 answer

How to authenticate GitHub with HTTParty to scrape a page?

I'm trying to scrape this page: https://github.com/search?p=1&q=https%3A%2F%2Fsonarcloud.io%2Fdashboard&type=Code and I need to authenticate with my email and password. I have tried to do that: auth = {:usarname => "username", :password =>…
-1
votes
2 answers

How do I return specific json keys/values from an API after a search, using the HTTParty gem?

At the moment I have a simple app that consumes an external API and allows a user to query and return json. It returns all keys/values but I would only like it to return lat and lon in json, or at least I would only like to show these two in my…
Steve
  • 418
  • 1
  • 4
  • 16
-1
votes
2 answers

How to use httparty instead of net/http or curl

I have a curl request which works curl -X GET -k 'https://APIADDRESSHERE' -u 'USERNAME:PASSWORD' -H 'Content-Type: application/json' I can also get this working in ruby: require 'net/http' require 'uri' require 'openssl' uri =…
Aaron Mills
  • 172
  • 1
  • 14
-1
votes
1 answer

How to send parameter that is part of url in httparty

I want to make a request to a URL: url = http://localhost:3000/api/v1/new_car/car_makes/:make/detail When I run: query[:make] = "honda" HTTParty.get(url, :query => query, :headers => @headers) I receive: params[:make] #=> nil and receive the…
Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133
-1
votes
1 answer

Rails Httparty JSON to params to save

Rails 4.5 Ruby 2.3.1 I am getting json from an API and trying to store the following into a model CLrates 1. timestamp as unix time (date) 2. Currency_code (string) 3. quote (decimal monetary value) I can use the following in irb after parsing the…
-1
votes
1 answer

How to get the facebook comment using HttParty

When i am trying to fetch the comments the i am getting this error message. article_url =…
-1
votes
1 answer

Change curl to httparty Rails

Can you please help me convert following command to httparty. curl -u username:token https://api.github.com/user I tried following but i am getting Requires authentication error. class GitApi include HTTParty base_uri…
AMBasra
  • 969
  • 8
  • 24
-1
votes
1 answer

Exception when using httparty for itunes verification

Here is a piece of code I wrote to implement itunes_verification. http://gist.github.com/raw/622038/b32accd30e86f7c714f2cffefd19857f558c8d97/gistfile1.rb ItunesVerification.verify_apple_receipt("wefwfrw") But, its always throwing…
Satya Kalluri
  • 5,148
  • 4
  • 28
  • 37
-1
votes
1 answer

Using kik's API with ruby

Ok so Im learning ruby and wanted to create a bot for kik https://dev.kik.com, I just don't understand whats wrong. Here is the Code require 'HTTParty' require 'base64' require 'json' bot_name = #bot_name api_key = #api_key message =…
Scope
  • 85
  • 2
  • 12
1 2 3
41
42