Created
October 13, 2016 09:57
-
-
Save checco/097c7c80d12018c19dce6c95fe007e57 to your computer and use it in GitHub Desktop.
JSON API call test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
require 'net/http' | |
url = URI("http://www.hostelspoint.com/webservices/affiliates/json.php?IDSite=2336&requestType=AvailSearchCity&day=11&year_month=2016-11&nights=1&guests=1¤cy=EUR&cat=&lang=en&order=&room_type=&city=190") | |
http = Net::HTTP.new(url.host, url.port) | |
request = Net::HTTP::Get.new(url) | |
request["cache-control"] = 'no-cache' | |
response = http.request(request) | |
puts response.read_body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment