Class: ProctorCam::Proctorserv::RestRequestClient

Inherits:
Object
  • Object
show all
Defined in:
lib/proctorserv_api/rest_request_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#responseObject

Returns the value of attribute response.



29
30
31
# File 'lib/proctorserv_api/rest_request_client.rb', line 29

def response
  @response
end

Instance Method Details

#make_get_request(url, customer_identifier, shared_secret, params) ⇒ Object



31
32
33
34
35
36
# File 'lib/proctorserv_api/rest_request_client.rb', line 31

def make_get_request(url, customer_identifier, shared_secret, params)
  HashedAuthenticator.apply_reverse_guid_and_sign(params, customer_identifier, shared_secret)
  RestClient.get url, :params => params, :accept => :json, :content_type => :json do |response, request, result, &block|
    return response
  end
end

#make_post_request(url, customer_identifier, shared_secret, params) ⇒ Object



38
39
40
41
42
43
# File 'lib/proctorserv_api/rest_request_client.rb', line 38

def make_post_request(url, customer_identifier, shared_secret, params)
  HashedAuthenticator.apply_reverse_guid_and_sign(params, customer_identifier, shared_secret)
  return RestClient.post url, params.to_json, :accept => :json, :content_type => :json do |response, request, result, &block|
    return response
  end
end