Method: Slack::API#post

Defined in:
lib/slack/api.rb

#post(api_method, payload) ⇒ Object



16
17
18
19
20
21
# File 'lib/slack/api.rb', line 16

def post(api_method, payload)
  url = "#{BASE_URL}/#{api_method}"
  headers = BASE_HEADERS.merge('Authorization' => "Bearer #{token}")

  Integrations::Clients::HTTP.post(url, body: payload.to_json, headers: headers)
end