Class: WebhookSystem::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/webhook_system/job.rb

Overview

Just a simple internal class to wrap around the http requests to the endpoints

Instance Method Summary collapse

Constructor Details

#initialize(endpoint) ⇒ HttpClient

Returns a new instance of HttpClient.



16
17
18
# File 'lib/webhook_system/job.rb', line 16

def initialize(endpoint)
  @endpoint = endpoint
end

Instance Method Details

#post(payload) ⇒ Object



20
21
22
23
24
25
# File 'lib/webhook_system/job.rb', line 20

def post(payload)
  client.post do |req|
    req.headers['Content-Type'] = 'application/json; base64+aes256'
    req.body = payload.to_s
  end
end