ruby/siteflow_api.rb
def request_put(path)
	timestamp = Time.now.utc.iso8601
	auth = create_hmac_auth("PUT", path, timestamp)
	
	uri = URI($baseUrl + path)

	request = Net::HTTP::Put.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

	return response
end
# HTTP PUT request
#
# Param: 
#   path - api path
#
# Note: baseUrl + path will be the full url to call a certain api
HTTP PUT request
Param:
path - api path

baseUrl + path will be the full url to call a certain api
HTTP PUT request Param : path - api path baseUrl + path will be the full url to call a certain api
def request_put(path)
	timestamp = Time.now.utc.iso8601
	auth = create_hmac_auth("PUT", path, timestamp)
	uri = URI($baseUrl + path)
	request = Net::HTTP::Put.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
	return response
end
def request_put ( path ) timestamp = Time . now . utc . iso8601 auth = create_hmac_auth ( "PUT" , path , timestamp ) uri = URI ( $baseUrl + path ) request = Net :: HTTP :: Put . 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 return response end
HTTP PUT request
Param:
path - api path
HTTP PUT request Param : path - api path
path