Class: ArkEcosystem::Client::HTTP::Client
- Inherits:
-
Object
- Object
- ArkEcosystem::Client::HTTP::Client
- Defined in:
- lib/arkecosystem/client/http/client.rb
Overview
The HTTP client used for sending requests.
Instance Attribute Summary collapse
-
#http_client ⇒ Object
Returns the value of attribute http_client.
Instance Method Summary collapse
-
#delete(url, query = {}) ⇒ Faraday::Response
Create and send a HTTP “DELETE” request.
-
#get(url, query = {}) ⇒ Faraday::Response
Create and send a HTTP “GET” request.
-
#initialize(config) ⇒ ArkEcosystem::Client::API::Two::Wallets
constructor
Create a new resource instance.
-
#post(url, payload = {}) ⇒ Faraday::Response
Create and send a HTTP “POST” request.
-
#put(url, payload = {}) ⇒ Faraday::Response
Create and send a HTTP “PUT” request.
Constructor Details
#initialize(config) ⇒ ArkEcosystem::Client::API::Two::Wallets
Create a new resource instance.
16 17 18 19 |
# File 'lib/arkecosystem/client/http/client.rb', line 16 def initialize(config) @host = config[:host] @http_client = nil end |
Instance Attribute Details
#http_client ⇒ Object
Returns the value of attribute http_client.
9 10 11 |
# File 'lib/arkecosystem/client/http/client.rb', line 9 def http_client @http_client end |
Instance Method Details
#delete(url, query = {}) ⇒ Faraday::Response
Create and send a HTTP “DELETE” request.
57 58 59 |
# File 'lib/arkecosystem/client/http/client.rb', line 57 def delete(url, query = {}) send_request(:delete, url, query) end |
#get(url, query = {}) ⇒ Faraday::Response
Create and send a HTTP “GET” request.
27 28 29 |
# File 'lib/arkecosystem/client/http/client.rb', line 27 def get(url, query = {}) send_request(:get, url, query) end |
#post(url, payload = {}) ⇒ Faraday::Response
Create and send a HTTP “POST” request.
37 38 39 |
# File 'lib/arkecosystem/client/http/client.rb', line 37 def post(url, payload = {}) send_request(:post, url, payload) end |
#put(url, payload = {}) ⇒ Faraday::Response
Create and send a HTTP “PUT” request.
47 48 49 |
# File 'lib/arkecosystem/client/http/client.rb', line 47 def put(url, payload = {}) send_request(:put, url, payload) end |