Class: ZeroSSL::HTTP
- Inherits:
-
Object
- Object
- ZeroSSL::HTTP
- Defined in:
- lib/zerossl/http.rb
Defined Under Namespace
Classes: Response
Constant Summary collapse
- VERBS =
{ get: Net::HTTP::Get, post: Net::HTTP::Post }
Instance Method Summary collapse
- #default_headers(opts = {}) ⇒ Object
- #default_params(opts = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize ⇒ HTTP
constructor
A new instance of HTTP.
- #post(path, options = {}) ⇒ Object
Constructor Details
Instance Method Details
#default_headers(opts = {}) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/zerossl/http.rb', line 22 def default_headers(opts = {}) { 'User-Agent' => @user_agent, 'Content-Type' => 'application/json', }.merge!(opts) end |
#default_params(opts = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/zerossl/http.rb', line 29 def default_params(opts = {}) { 'access_key' => @access_key }.merge!(opts) end |
#get(path, options = {}) ⇒ Object
35 36 37 |
# File 'lib/zerossl/http.rb', line 35 def get(path, = {}) execute(path, :get, ) end |
#post(path, options = {}) ⇒ Object
39 40 41 |
# File 'lib/zerossl/http.rb', line 39 def post(path, = {}) execute(path, :post, ) end |