Module: ContextIO::Request Private
- Defined in:
- lib/context-io/request.rb,
lib/context-io/request/oauth.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Methods for sending HTTP requests
Defined Under Namespace
Classes: ContextIOOAuth
Instance Method Summary collapse
-
#delete(path, params = {}) ⇒ Hash, ...
private
Perform an HTTP DELETE request.
-
#get(path, params = {}) ⇒ Hash, ...
private
Perform an HTTP GET request.
-
#post(path, params = {}) ⇒ Hash, ...
private
Perform an HTTP POST request.
-
#put(path, params = {}) ⇒ Hash, ...
private
Perform an HTTP PUT request.
-
#request(method, path, params) ⇒ Hash, ...
private
Perform an HTTP request.
Instance Method Details
#delete(path, params = {}) ⇒ Hash, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Perform an HTTP DELETE request
12 13 14 |
# File 'lib/context-io/request.rb', line 12 def delete(path, params={}) request(:delete, path, params) end |
#get(path, params = {}) ⇒ Hash, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Perform an HTTP GET request
22 23 24 |
# File 'lib/context-io/request.rb', line 22 def get(path, params={}) request(:get, path, params) end |
#post(path, params = {}) ⇒ Hash, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Perform an HTTP POST request
32 33 34 |
# File 'lib/context-io/request.rb', line 32 def post(path, params={}) request(:post, path, params) end |
#put(path, params = {}) ⇒ Hash, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Perform an HTTP PUT request
42 43 44 |
# File 'lib/context-io/request.rb', line 42 def put(path, params={}) request(:put, path, params) end |
#request(method, path, params) ⇒ Hash, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Perform an HTTP request
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/context-io/request.rb', line 55 def request(method, path, params) response = connection(params.delete(:raw)).send(method) do |request| case method.to_sym when :delete, :get, :put request.url(path, params) when :post request.path = path request.body = params unless params.empty? end end response.body end |