Module: Nucleus::Adapters::HttpClient
- Included in:
- BaseAdapter
- Defined in:
- lib/nucleus/core/adapter_extensions/http_client.rb
Instance Method Summary collapse
-
#delete(path, params = {}) ⇒ Object
Executes a DELETE request to the given URL.
-
#get(path, params = {}) ⇒ Object
Executes a GET request to the given URL.
-
#head(path, params = {}) ⇒ Object
Executes a HEAD request to the given URL.
-
#patch(path, params = {}) ⇒ Object
Executes a PATCH request to the given URL.
-
#post(path, params = {}) ⇒ Object
Executes a POST request to the given URL.
-
#put(path, params = {}) ⇒ Object
Executes a PUT request to the given URL.
Instance Method Details
#delete(path, params = {}) ⇒ Object
Executes a DELETE request to the given URL.
unprocessed response
81 82 83 |
# File 'lib/nucleus/core/adapter_extensions/http_client.rb', line 81 def delete(path, params = {}) execute_request(:delete, [200, 204], path, params, params.delete(:native_call) { false }) end |
#get(path, params = {}) ⇒ Object
Executes a GET request to the given URL.
unprocessed response
26 27 28 |
# File 'lib/nucleus/core/adapter_extensions/http_client.rb', line 26 def get(path, params = {}) execute_request(:get, [200], path, params, params.delete(:native_call) { false }) end |
#head(path, params = {}) ⇒ Object
Executes a HEAD request to the given URL.
unprocessed response
13 14 15 |
# File 'lib/nucleus/core/adapter_extensions/http_client.rb', line 13 def head(path, params = {}) execute_request(:head, [200], path, params, params.delete(:native_call) { false }) end |
#patch(path, params = {}) ⇒ Object
Executes a PATCH request to the given URL.
unprocessed response
54 55 56 |
# File 'lib/nucleus/core/adapter_extensions/http_client.rb', line 54 def patch(path, params = {}) execute_request(:patch, [200, 201], path, params, params.delete(:native_call) { false }) end |
#post(path, params = {}) ⇒ Object
Executes a POST request to the given URL.
unprocessed response
40 41 42 |
# File 'lib/nucleus/core/adapter_extensions/http_client.rb', line 40 def post(path, params = {}) execute_request(:post, [200, 201], path, params, params.delete(:native_call) { false }) end |
#put(path, params = {}) ⇒ Object
Executes a PUT request to the given URL.
unprocessed response
68 69 70 |
# File 'lib/nucleus/core/adapter_extensions/http_client.rb', line 68 def put(path, params = {}) execute_request(:put, [200, 201], path, params, params.delete(:native_call) { false }) end |