Class: Playwright::Response
- Inherits:
-
PlaywrightApi
- Object
- PlaywrightApi
- Playwright::Response
- Defined in:
- lib/playwright_api/response.rb
Overview
‘Response` class represents responses which are received by page.
Instance Method Summary collapse
- #after_initialize ⇒ Object
-
#body ⇒ Object
Returns the buffer with response body.
-
#finished ⇒ Object
Waits for this response to finish, returns failure error if request failed.
-
#frame ⇒ Object
Returns the ‘Frame` that initiated this response.
-
#headers ⇒ Object
Returns the object with HTTP headers associated with the response.
-
#json ⇒ Object
Returns the JSON representation of response body.
-
#off(event, callback) ⇒ Object
– inherited from EventEmitter –.
-
#ok ⇒ Object
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
- #ok? ⇒ Boolean
-
#on(event, callback) ⇒ Object
– inherited from EventEmitter –.
-
#once(event, callback) ⇒ Object
– inherited from EventEmitter –.
-
#request ⇒ Object
Returns the matching ‘Request` object.
-
#status ⇒ Object
Contains the status code of the response (e.g., 200 for a success).
-
#status_text ⇒ Object
Contains the status text of the response (e.g. usually an “OK” for a success).
-
#text ⇒ Object
Returns the text representation of response body.
-
#url ⇒ Object
Contains the URL of the response.
Methods inherited from PlaywrightApi
Constructor Details
This class inherits a constructor from Playwright::PlaywrightApi
Instance Method Details
#after_initialize ⇒ Object
68 69 70 |
# File 'lib/playwright_api/response.rb', line 68 def after_initialize wrap_impl(@impl.after_initialize) end |
#body ⇒ Object
Returns the buffer with response body.
6 7 8 |
# File 'lib/playwright_api/response.rb', line 6 def body wrap_impl(@impl.body) end |
#finished ⇒ Object
Waits for this response to finish, returns failure error if request failed.
11 12 13 |
# File 'lib/playwright_api/response.rb', line 11 def finished wrap_impl(@impl.finished) end |
#frame ⇒ Object
Returns the ‘Frame` that initiated this response.
16 17 18 |
# File 'lib/playwright_api/response.rb', line 16 def frame wrap_impl(@impl.frame) end |
#headers ⇒ Object
Returns the object with HTTP headers associated with the response. All header names are lower-case.
21 22 23 |
# File 'lib/playwright_api/response.rb', line 21 def headers wrap_impl(@impl.headers) end |
#json ⇒ Object
Returns the JSON representation of response body.
This method will throw if the response body is not parsable via ‘JSON.parse`.
28 29 30 |
# File 'lib/playwright_api/response.rb', line 28 def json wrap_impl(@impl.json) end |
#off(event, callback) ⇒ Object
– inherited from EventEmitter –
74 75 76 |
# File 'lib/playwright_api/response.rb', line 74 def off(event, callback) event_emitter_proxy.off(event, callback) end |
#ok ⇒ Object
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
33 34 35 |
# File 'lib/playwright_api/response.rb', line 33 def ok wrap_impl(@impl.ok) end |
#ok? ⇒ Boolean
63 64 65 |
# File 'lib/playwright_api/response.rb', line 63 def ok? wrap_impl(@impl.ok?) end |
#on(event, callback) ⇒ Object
– inherited from EventEmitter –
86 87 88 |
# File 'lib/playwright_api/response.rb', line 86 def on(event, callback) event_emitter_proxy.on(event, callback) end |
#once(event, callback) ⇒ Object
– inherited from EventEmitter –
80 81 82 |
# File 'lib/playwright_api/response.rb', line 80 def once(event, callback) event_emitter_proxy.once(event, callback) end |
#request ⇒ Object
Returns the matching ‘Request` object.
38 39 40 |
# File 'lib/playwright_api/response.rb', line 38 def request wrap_impl(@impl.request) end |
#status ⇒ Object
Contains the status code of the response (e.g., 200 for a success).
43 44 45 |
# File 'lib/playwright_api/response.rb', line 43 def status wrap_impl(@impl.status) end |
#status_text ⇒ Object
Contains the status text of the response (e.g. usually an “OK” for a success).
48 49 50 |
# File 'lib/playwright_api/response.rb', line 48 def status_text wrap_impl(@impl.status_text) end |
#text ⇒ Object
Returns the text representation of response body.
53 54 55 |
# File 'lib/playwright_api/response.rb', line 53 def text wrap_impl(@impl.text) end |
#url ⇒ Object
Contains the URL of the response.
58 59 60 |
# File 'lib/playwright_api/response.rb', line 58 def url wrap_impl(@impl.url) end |