Module: FlexmlsApi::Request
- Included in:
- Client
- Defined in:
- lib/flexmls_api/request.rb
Overview
HTTP request wrapper. Performs all the api session mumbo jumbo so that the models don’t have to.
Instance Method Summary collapse
-
#delete(path, options = {}) ⇒ Object
Perform an HTTP DELETE request.
-
#get(path, options = {}) ⇒ Object
Perform an HTTP GET request.
-
#post(path, body = {}, options = {}) ⇒ Object
Perform an HTTP POST request.
-
#put(path, body = {}, options = {}) ⇒ Object
Perform an HTTP PUT request.
Instance Method Details
#delete(path, options = {}) ⇒ Object
Perform an HTTP DELETE request
-
path - Path of an api resource, excluding version and endpoint (domain) information
-
options - Resource request options as specified being supported via and api resource
:returns:
Hash of the json results as documented in the api.
:raises:
FlexmlsApi::ClientError or subclass if the request failed.
52 53 54 |
# File 'lib/flexmls_api/request.rb', line 52 def delete(path, ={}) request(:delete, path, nil, ) end |
#get(path, options = {}) ⇒ Object
Perform an HTTP GET request
-
path - Path of an api resource, excluding version and endpoint (domain) information
-
options - Resource request options as specified being supported via and api resource
:returns:
Hash of the json results as documented in the api.
:raises:
FlexmlsApi::ClientError or subclass if the request failed.
14 15 16 |
# File 'lib/flexmls_api/request.rb', line 14 def get(path, ={}) request(:get, path, nil, ) end |
#post(path, body = {}, options = {}) ⇒ Object
Perform an HTTP POST request
-
path - Path of an api resource, excluding version and endpoint (domain) information
-
body - Hash for post body data
-
options - Resource request options as specified being supported via and api resource
:returns:
Hash of the json results as documented in the api.
:raises:
FlexmlsApi::ClientError or subclass if the request failed.
27 28 29 |
# File 'lib/flexmls_api/request.rb', line 27 def post(path, body={}, ={}) request(:post, path, body, ) end |
#put(path, body = {}, options = {}) ⇒ Object
Perform an HTTP PUT request
-
path - Path of an api resource, excluding version and endpoint (domain) information
-
body - Hash for post body data
-
options - Resource request options as specified being supported via and api resource
:returns:
Hash of the json results as documented in the api.
:raises:
FlexmlsApi::ClientError or subclass if the request failed.
40 41 42 |
# File 'lib/flexmls_api/request.rb', line 40 def put(path, body={}, ={}) request(:put, path, body, ) end |