Method: Synapse::HTTPClient#headers

Defined in:
lib/synapse_api/http_request.rb

#headersHash Also known as: get_headers

Returns:

  • (Hash)


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/synapse_api/http_request.rb', line 43

def headers
	user    = "#{config[:oauth_key]}|#{config[:fingerprint]}"
	gateway = "#{config[:client_id]}|#{config[:client_secret]}"
	headers = {
		content_type: :json,
		accept: :json,
		'X-SP-GATEWAY' => gateway,
	    'X-SP-USER'    => user,
	    'X-SP-USER-IP' => config[:ip_address],
	}
    if config[:idemopotency_key]
      headers['X-SP-IDEMPOTENCY-KEY'] = config[:idemopotency_key]
    end
    headers
end