1

I've been at this for awhile. I've tried using net http to connect to a https url with no luck. I've tried http party and getting uninitialized constant httpparty. I am running rails 3.2.7. I have httpparty add to gem file.

Can someone please provide an example with either problem sending params to a https url and receiving a response.

code:

options = {:id => params[:id], :code => params[:code]}
response = HTTPParty.post('https://test.com', options)

gem file:

gem "httparty", "~> 0.9.0"
Brian
  • 5,951
  • 14
  • 53
  • 77

1 Answers1

1
HTTParty.get('https://google.com', :query => {:q => 'stack overflow'})

If this doesn't work for you, please show the code you're using. It you're getting an uninitialized constant error, you've done something wrong. Did you run bundle after adding to your Gemfile?

Also, it's HTTParty, not HTTPParty.

x1a4
  • 19,417
  • 5
  • 40
  • 40