def to_json(*a)
      res_dict = response ? { body: response.body, headers: response.headers, status: response.status } : nil
      {message: @msg, request: request, response: res_dict}.to_json(*a)
    end
def to_json(*a)
      res_dict = response ? { body: response.body, headers: response.headers, status: response.status } : nil
      {message: @msg, request: request, response: res_dict}.to_json(*a)
    end
Creates and initialize new instance of the HttpOperationException class.
 @param [Hash] the HTTP request data (uri, body, headers).
 @param [Faraday::Response] the HTTP response object.
 @param [String] body the HTTP response body.
 @param [String] error message.