Class: Mastodon::Headers

Inherits:
Object
  • Object
show all
Defined in:
lib/mastodon/headers.rb

Overview

Class to handle headers. Important for OAuth2 to work properly.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Headers

Returns a new instance of Headers.

Parameters:



7
8
9
# File 'lib/mastodon/headers.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#request_headersHash

Returns:

  • (Hash)


12
13
14
15
16
17
18
# File 'lib/mastodon/headers.rb', line 12

def request_headers
  {
    user_agent: @client.user_agent,
    accept: '*/*',
    authorization: "Bearer #{@client.bearer_token}"
  }
end