class WebkitRemote::Client::NetworkResponse

Wraps information about responses to network requests.

Attributes

connection_id[R]

@return [Number] id of the network connection used by the browser to fetch

this resource
connection_reused[R]

@return [Boolean] true if the network connection used for this request was

already open
from_cache[R]

@return [Boolean] true if the request was served from cache

headers[R]

@return [Hash<String, String>] HTTP response headers

mime_type[R]

@return [String] the browser-determined response MIME type

request_headers[R]

@return [Hash<String, String>] HTTP request headers

status[R]

@return [Number] HTTP status code

status_text[R]

@return [String] HTTP status message

url[R]

@return [String] the URL of the response

Public Class Methods

new(raw_response) click to toggle source

@private use Event#for instead of calling this constructor directly

@param [Hash<String, Number>] the raw RPC data for a Response object

in the Network domain
# File lib/webkit_remote/client/network_events.rb, line 406
def initialize(raw_response)
  @connection_id = raw_response['connectionId']
  @connection_reused = raw_response['connectionReused'] || false
  @from_cache = raw_response['fromDiskCache'] || false
  @headers = raw_response['headers'] || {}
  @mime_type = raw_response['mimeType']
  @request_headers = raw_response['requestHeaders'] || {}
  @status = raw_response['status']
  @status_text = raw_response['statusText']
  if raw_response['timing']
    @timing = WebkitRemote::Client::NetworkResourceTiming.new(
        raw_response['timing'])
  else
    @timing = nil
  end
  @url = raw_response['url']
end