class Playwright::Response

‘Response` class represents responses which are received by page.

def all_headers

An object with all the response HTTP headers associated with this response.
def all_headers
  wrap_impl(@impl.all_headers)
end

def body

Returns the buffer with response body.
def body
  wrap_impl(@impl.body)
end

def event_emitter_proxy

def event_emitter_proxy
_emitter_proxy ||= EventEmitterProxy.new(self, @impl)

def finished

Waits for this response to finish, returns always `null`.
def finished
  wrap_impl(@impl.finished)
end

def frame

Returns the `Frame` that initiated this response.
def frame
  wrap_impl(@impl.frame)
end

def from_service_worker

Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via [FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)).
def from_service_worker
  wrap_impl(@impl.from_service_worker)
end

def from_service_worker?

@nodoc
def from_service_worker?
  wrap_impl(@impl.from_service_worker?)
end

def header_value(name)

the same name (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\n` separator is used. If no headers are found, `null` is returned.
Returns the value of the header matching the name. The name is case insensitive. If multiple headers have
def header_value(name)
  wrap_impl(@impl.header_value(unwrap_impl(name)))
end

def header_values(name)

Returns all values of the headers matching the name, for example `set-cookie`. The name is case insensitive.
def header_values(name)
  wrap_impl(@impl.header_values(unwrap_impl(name)))
end

def headers

You can use [`method: Response.allHeaders`] for complete list of headers that include `cookie` information.
Note that this method does not return security-related headers, including cookie-related ones.
An object with the response HTTP headers. The header names are lower-cased.
def headers
  wrap_impl(@impl.headers)
end

def headers_array

Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
An array with all the request HTTP headers associated with this response. Unlike [`method: Response.allHeaders`], header names are NOT lower-cased.
def headers_array
  wrap_impl(@impl.headers_array)
end

def json

This method will throw if the response body is not parsable via `JSON.parse`.

Returns the JSON representation of response body.
def json
  wrap_impl(@impl.json)
end

def off(event, callback)

@nodoc
-- inherited from EventEmitter --
def off(event, callback)
  event_emitter_proxy.off(event, callback)
end

def ok

Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
def ok
  wrap_impl(@impl.ok)
end

def ok?

@nodoc
def ok?
  wrap_impl(@impl.ok?)
end

def on(event, callback)

@nodoc
-- inherited from EventEmitter --
def on(event, callback)
  event_emitter_proxy.on(event, callback)
end

def once(event, callback)

@nodoc
-- inherited from EventEmitter --
def once(event, callback)
  event_emitter_proxy.once(event, callback)
end

def request

Returns the matching `Request` object.
def request
  wrap_impl(@impl.request)
end

def security_details

Returns SSL and other security information.
def security_details
  wrap_impl(@impl.security_details)
end

def server_addr

Returns the IP address and port of the server.
def server_addr
  wrap_impl(@impl.server_addr)
end

def status

Contains the status code of the response (e.g., 200 for a success).
def status
  wrap_impl(@impl.status)
end

def status_text

Contains the status text of the response (e.g. usually an "OK" for a success).
def status_text
  wrap_impl(@impl.status_text)
end

def text

Returns the text representation of response body.
def text
  wrap_impl(@impl.text)
end

def url

Contains the URL of the response.
def url
  wrap_impl(@impl.url)
end