Module: BerkeleyLibrary::Util::URIs::Requester
- Extended by:
- Logging
- Defined in:
- lib/berkeley_library/util/uris/requester.rb
Class Method Summary collapse
-
.get(uri, params: {}, headers: {}) ⇒ String
Performs a GET request and returns the response body as a string.
-
.get_response(uri, params: {}, headers: {}) ⇒ RestClient::Response
Performs a GET request and returns the response.
Class Method Details
.get(uri, params: {}, headers: {}) ⇒ String
Performs a GET request and returns the response body as a string.
20 21 22 23 |
# File 'lib/berkeley_library/util/uris/requester.rb', line 20 def get(uri, params: {}, headers: {}) resp = make_get_request(uri, params, headers) resp.body end |
.get_response(uri, params: {}, headers: {}) ⇒ RestClient::Response
Performs a GET request and returns the response.
31 32 33 34 35 |
# File 'lib/berkeley_library/util/uris/requester.rb', line 31 def get_response(uri, params: {}, headers: {}) make_get_request(uri, params, headers) rescue RestClient::Exception => e e.response end |