Module: LoogiHttp
- Defined in:
- lib/loogi_http.rb,
lib/loogi_http/error.rb,
lib/loogi_http/builder.rb,
lib/loogi_http/version.rb,
lib/loogi_http/response.rb,
lib/loogi_http/connection.rb,
lib/loogi_http/middleware.rb,
lib/loogi_http/configuration.rb,
lib/loogi_http/middleware/debug_http.rb,
lib/loogi_http/middleware/log_request.rb,
lib/loogi_http/middleware/request/accept_json.rb
Defined Under Namespace
Modules: Middleware Classes: Builder, Configuration, Connection, ConnectionFailed, Error, Response, ServerError, TimeoutError
Constant Summary collapse
- VERSION =
'2.0.0'.freeze
Class Method Summary collapse
-
.json_post(url, params: {}, data: nil, options: {}) ⇒ Object
HTTP POST with JSON data sent and expected as the response.
-
.log_level ⇒ Object
The log level to use with the logger.
-
.log_level=(log_level) ⇒ Object
Set the log level to use with the logger.
-
.logger ⇒ Object
The Logger to use when logging.
-
.logger=(logger) ⇒ Object
Set the Logger to use when logging.
Class Method Details
.json_post(url, params: {}, data: nil, options: {}) ⇒ Object
HTTP POST with JSON data sent and expected as the response.
(see LoogiHttp::Connection#post)
36 37 38 39 40 41 42 43 |
# File 'lib/loogi_http.rb', line 36 def self.json_post(url, params: {}, data: nil, options: {}) LoogiHttp::Builder.json.post( url, params: params, data: data, options: ) end |
.log_level ⇒ Object
The log level to use with the logger. Defaults to ‘info`.
9 10 11 |
# File 'lib/loogi_http.rb', line 9 def self.log_level @log_level ||= :info end |
.log_level=(log_level) ⇒ Object
Set the log level to use with the logger
16 17 18 |
# File 'lib/loogi_http.rb', line 16 def self.log_level=(log_level) @log_level = log_level end |
.logger ⇒ Object
The Logger to use when logging
21 22 23 |
# File 'lib/loogi_http.rb', line 21 def self.logger @logger ||= nil # Silence warning end |
.logger=(logger) ⇒ Object
Set the Logger to use when logging
28 29 30 |
# File 'lib/loogi_http.rb', line 28 def self.logger=(logger) @logger = logger end |