Class: QuickEmailVerification::HttpClient::ResponseHandler
- Inherits:
-
Object
- Object
- QuickEmailVerification::HttpClient::ResponseHandler
- Defined in:
- lib/quickemailverification/http_client/response_handler.rb
Overview
ResponseHandler takes care of decoding the response body into suitable type
Class Method Summary collapse
Class Method Details
.get_body(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/quickemailverification/http_client/response_handler.rb', line 8 def self.get_body(env) type = env.response_headers["content-type"] || '' body = env.body # Response body is in JSON if type.include?("json") body = JSON.parse body end return body end |