class RestClientHasher::Requests

Public Class Methods

get_json_from_url(input_url) click to toggle source
# File lib/rest_client_hasher.rb, line 18
def self.get_json_from_url input_url
  response = RestClient.get(input_url)
  response.code.should == 200
  JSON.parse response.body
end
post_json_to_url(input_url, json_body) click to toggle source
# File lib/rest_client_hasher.rb, line 6
def self.post_json_to_url input_url, json_body
  response = RestClient.post(input_url, json_body, :content_type => 'application/json')
  response.code.should == 200
  JSON.parse response.body
end
put_json_to_url(input_url, json_body) click to toggle source
# File lib/rest_client_hasher.rb, line 12
def self.put_json_to_url input_url, json_body
  response = RestClient.put(input_url, json_body, :content_type => 'application/json')
  response.code.should == 200
  JSON.parse response.body
end