Class: WebhookSystem::HttpClient
- Inherits:
-
Object
- Object
- WebhookSystem::HttpClient
- 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
-
#initialize(endpoint) ⇒ HttpClient
constructor
A new instance of HttpClient.
- #post(payload) ⇒ Object
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 |