class Playwright::Response
`Response` class represents responses which are received by page.
Public Instance Methods
Returns the buffer with response body.
# File lib/playwright_api/response.rb, line 6 def body wrap_impl(@impl.body) end
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
Returns the `Frame` that initiated this response.
# File lib/playwright_api/response.rb, line 16 def frame wrap_impl(@impl.frame) end
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
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
– inherited from EventEmitter
– @nodoc
# File lib/playwright_api/response.rb, line 91 def off(event, callback) event_emitter_proxy.off(event, callback) end
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
@nodoc
# File lib/playwright_api/response.rb, line 73 def ok? wrap_impl(@impl.ok?) end
– inherited from EventEmitter
– @nodoc
# File lib/playwright_api/response.rb, line 85 def on(event, callback) event_emitter_proxy.on(event, callback) end
– inherited from EventEmitter
– @nodoc
# File lib/playwright_api/response.rb, line 79 def once(event, callback) event_emitter_proxy.once(event, callback) end
Returns the matching `Request` object.
# File lib/playwright_api/response.rb, line 38 def request wrap_impl(@impl.request) end
Returns SSL and other security information.
# File lib/playwright_api/response.rb, line 43 def security_details wrap_impl(@impl.security_details) end
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
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
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
Returns the text representation of response body.
# File lib/playwright_api/response.rb, line 63 def text wrap_impl(@impl.text) end
Contains the URL of the response.
# File lib/playwright_api/response.rb, line 68 def url wrap_impl(@impl.url) end
Private Instance Methods
# File lib/playwright_api/response.rb, line 95 def event_emitter_proxy @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl) end