class MsRest::HttpOperationResponse

Class which represents the data received and deserialized from server.

Attributes

body[RW]

@return [String] the HTTP response body.

request[RW]

@param [MsRest::HttpOperationRequest] the HTTP request data.

response[RW]

@return [Faraday::Response] the HTTP response object.

Public Class Methods

new(request, response, body = nil) click to toggle source

Creates and initialize new instance of the HttpOperationResponse class. @param [MsRest::HttpOperationRequest] request the HTTP request object. @param [Faraday::Response] response the HTTP response object. @param [String] body the HTTP response body.

# File lib/ms_rest/http_operation_response.rb, line 24
def initialize(request, response, body = nil)
  @request = request
  @response = response
  @body = body
end

Public Instance Methods

to_json(*a) click to toggle source
# File lib/ms_rest/http_operation_response.rb, line 30
def to_json(*a)
  res_dict = response ? { body: response.body, headers: response.headers, status: response.status } : nil
  {response: res_dict, request: request}.to_json(*a)
end