class Playwright::Response

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

Public Instance Methods

body() click to toggle source

Returns the buffer with response body.

# File lib/playwright_api/response.rb, line 6
def body
  wrap_impl(@impl.body)
end
finished() click to toggle source

Waits for this response to finish, returns failure error if request failed.

# File lib/playwright_api/response.rb, line 11
def finished
  wrap_impl(@impl.finished)
end
frame() click to toggle source

Returns the `Frame` that initiated this response.

# File lib/playwright_api/response.rb, line 16
def frame
  wrap_impl(@impl.frame)
end
headers() click to toggle source

Returns the object with HTTP headers associated with the response. All header names are lower-case.

# File lib/playwright_api/response.rb, line 21
def headers
  wrap_impl(@impl.headers)
end
json() click to toggle source

Returns the JSON representation of response body.

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

# File lib/playwright_api/response.rb, line 28
def json
  wrap_impl(@impl.json)
end
off(event, callback) click to toggle source

– inherited from EventEmitter – @nodoc

# File lib/playwright_api/response.rb, line 91
def off(event, callback)
  event_emitter_proxy.off(event, callback)
end
ok() click to toggle source

Contains a boolean stating whether the response was successful (status in the range 200-299) or not.

# File lib/playwright_api/response.rb, line 33
def ok
  wrap_impl(@impl.ok)
end
ok?() click to toggle source

@nodoc

# File lib/playwright_api/response.rb, line 73
def ok?
  wrap_impl(@impl.ok?)
end
on(event, callback) click to toggle source

– inherited from EventEmitter – @nodoc

# File lib/playwright_api/response.rb, line 85
def on(event, callback)
  event_emitter_proxy.on(event, callback)
end
once(event, callback) click to toggle source

– inherited from EventEmitter – @nodoc

# File lib/playwright_api/response.rb, line 79
def once(event, callback)
  event_emitter_proxy.once(event, callback)
end
request() click to toggle source

Returns the matching `Request` object.

# File lib/playwright_api/response.rb, line 38
def request
  wrap_impl(@impl.request)
end
security_details() click to toggle source

Returns SSL and other security information.

# File lib/playwright_api/response.rb, line 43
def security_details
  wrap_impl(@impl.security_details)
end
server_addr() click to toggle source

Returns the IP address and port of the server.

# File lib/playwright_api/response.rb, line 48
def server_addr
  wrap_impl(@impl.server_addr)
end
status() click to toggle source

Contains the status code of the response (e.g., 200 for a success).

# File lib/playwright_api/response.rb, line 53
def status
  wrap_impl(@impl.status)
end
status_text() click to toggle source

Contains the status text of the response (e.g. usually an “OK” for a success).

# File lib/playwright_api/response.rb, line 58
def status_text
  wrap_impl(@impl.status_text)
end
text() click to toggle source

Returns the text representation of response body.

# File lib/playwright_api/response.rb, line 63
def text
  wrap_impl(@impl.text)
end
url() click to toggle source

Contains the URL of the response.

# File lib/playwright_api/response.rb, line 68
def url
  wrap_impl(@impl.url)
end

Private Instance Methods

event_emitter_proxy() click to toggle source
# File lib/playwright_api/response.rb, line 95
        def event_emitter_proxy
  @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
end