ruby/box_api.rb
# HTTP GET request with a mime_type parameter
#
# Param: 
#   path - api path
#   param - MIME type to be added to the end of path
#
# Note: +baseUrl + path + param will be the full url to get the aws urls specific to the MIME type.
HTTP GET request with a mime_type parameter
Param:
path - api path
param - MIME type to be added to the end of path

+baseUrl + path + param will be the full url to get the aws urls specific to the MIME type.
HTTP GET request with a mime_type parameter Param : path - api path param - MIME type to be added to the end of path + baseUrl + path + param will be the full url to get the aws urls specific to the MIME type .
def request_get_with_param(path, param)
	timestamp = Time.now.utc.iso8601
	auth = create_hmac_auth("GET", path, timestamp)
	uri = URI($baseUrl + path + "?mimeType=" + param)
	request = Net::HTTP::Get.new(uri)
	request.add_field("x-hp-hmac-authentication", auth)
	request.add_field("x-hp-hmac-date", timestamp)
	response = Net::HTTP.start(uri.host, uri.port,
		:use_ssl => uri.scheme == 'https',
		:verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|
		http.request(request)
	end
end
def request_get_with_param ( path , param ) timestamp = Time . now . utc . iso8601 auth = create_hmac_auth ( "GET" , path , timestamp ) uri = URI ( $baseUrl + path + "?mimeType=" + param ) request = Net :: HTTP :: Get . new ( uri ) request . add_field ( "x-hp-hmac-authentication" , auth ) request . add_field ( "x-hp-hmac-date" , timestamp ) response = Net :: HTTP . start ( uri . host , uri . port , :use_ssl => uri . scheme == 'https' , :verify_mode => OpenSSL :: SSL :: VERIFY_NONE ) do | http | http . request ( request ) end end
HTTP GET request with a mime_type parameter
Param:
path - api path
param - MIME type to be added to the end of path
HTTP GET request with a mime_type parameter Param : path - api path param - MIME type to be added to the end of path
path
param