Class: Teamsupport::Headers
- Inherits:
-
Object
- Object
- Teamsupport::Headers
- Defined in:
- lib/teamsupport/headers.rb
Instance Method Summary collapse
-
#initialize(client, request_method, url, options = {}) ⇒ Teamsupport::Headers
constructor
private
Initializes a new Headers object.
-
#request_headers ⇒ Hash
Returns HTTP request headers for the client.
Constructor Details
#initialize(client, request_method, url, options = {}) ⇒ Teamsupport::Headers
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes a new Headers object
16 17 18 19 20 21 |
# File 'lib/teamsupport/headers.rb', line 16 def initialize(client, request_method, url, = {}) @client = client @request_method = request_method.to_sym @uri = Addressable::URI.parse(url) @options = end |
Instance Method Details
#request_headers ⇒ Hash
Returns HTTP request headers for the client
33 34 35 36 37 38 |
# File 'lib/teamsupport/headers.rb', line 33 def request_headers headers = {'Content-Type' => 'application/json'} headers[:user_agent] = @client.user_agent headers[:authorization] = auth_header headers end |