Class: Line::Bot::Headers

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

Instance Method Summary (collapse)

Constructor Details

- (Headers) initialize(client, request_method, url, options = {})

Returns a new instance of Headers



4
5
6
7
8
9
# File 'lib/line/bot/headers.rb', line 4

def initialize(client, request_method, url, options = {})
  @client         = client
  @request_method = request_method.to_sym
  @uri            = URI(url)
  @options        = options
end

Instance Method Details

- (Object) request_headers



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

def request_headers
  {
    'User-Agent'                   => @client.user_agent,
    'Content-Type'                 => 'application/json; charset=UTF-8',
    'X-Line-ChannelID'             => @client.channel_id,
    'X-Line-ChannelSecret'         => @client.channel_secret,
    'X-Line-Trusted-User-With-ACL' => @client.channel_mid
  }
end