Class: Certynix::HttpClient
- Inherits:
-
Object
- Object
- Certynix::HttpClient
- Defined in:
- lib/certynix/http_client.rb
Constant Summary collapse
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path, params = {}) ⇒ Object
-
#get_public(path, params = {}) ⇒ Object
GET sem autenticação — para endpoints públicos (verify).
-
#initialize(config) ⇒ HttpClient
constructor
A new instance of HttpClient.
- #post(path, body = nil) ⇒ Object
- #post_public(path, body = nil) ⇒ Object
- #put(path, body = nil) ⇒ Object
Constructor Details
#initialize(config) ⇒ HttpClient
Returns a new instance of HttpClient.
12 13 14 15 |
# File 'lib/certynix/http_client.rb', line 12 def initialize(config) @config = config @conn = build_connection end |
Instance Method Details
#delete(path) ⇒ Object
29 30 31 32 |
# File 'lib/certynix/http_client.rb', line 29 def delete(path) request(:delete, path) nil end |
#get(path, params = {}) ⇒ Object
17 18 19 |
# File 'lib/certynix/http_client.rb', line 17 def get(path, params = {}) request(:get, path, params: compact_params(params)) end |
#get_public(path, params = {}) ⇒ Object
GET sem autenticação — para endpoints públicos (verify)
35 36 37 |
# File 'lib/certynix/http_client.rb', line 35 def get_public(path, params = {}) request(:get, path, params: compact_params(params), public: true) end |
#post(path, body = nil) ⇒ Object
21 22 23 |
# File 'lib/certynix/http_client.rb', line 21 def post(path, body = nil) request(:post, path, body: body) end |
#post_public(path, body = nil) ⇒ Object
39 40 41 |
# File 'lib/certynix/http_client.rb', line 39 def post_public(path, body = nil) request(:post, path, body: body, public: true) end |
#put(path, body = nil) ⇒ Object
25 26 27 |
# File 'lib/certynix/http_client.rb', line 25 def put(path, body = nil) request(:put, path, body: body) end |