class Playwright::APIResponse
“‘
assert response.body() == ’{“status”: “ok”}‘
assert response.json() == “foobar”
assert response.headers == “application/json; charset=utf-8”
assert response.status == 200
assert response.ok
response = context.get(“example.com/user/repos”)
context = playwright.request.new_context()
with sync_playwright() as p:
from playwright.sync_api import sync_playwright
“`python sync
`APIResponse` class represents responses returned by [`method: APIRequestContext.get`] and similar methods.
def body
def body wrap_impl(@impl.body) end
def dispose
def dispose wrap_impl(@impl.dispose) end
def headers
def headers wrap_impl(@impl.headers) end
def headers_array
An array with all the request HTTP headers associated with this response. Header names are not lower-cased.
def headers_array wrap_impl(@impl.headers_array) end
def json
Returns the JSON representation of response body.
def json wrap_impl(@impl.json) end
def ok
def ok wrap_impl(@impl.ok) end
def ok?
def ok? wrap_impl(@impl.ok?) end
def status
def status wrap_impl(@impl.status) end
def status_text
def status_text wrap_impl(@impl.status_text) end
def text
def text wrap_impl(@impl.text) end
def to_s
def to_s wrap_impl(@impl.to_s) end
def url
def url wrap_impl(@impl.url) end