Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
playwright.sync_api._generated.Request Class Reference
Inheritance diagram for playwright.sync_api._generated.Request:
Inheritance graph
[legend]
Collaboration diagram for playwright.sync_api._generated.Request:
Collaboration graph
[legend]

Public Member Functions

str url (self)
 
str resource_type (self)
 
typing.Optional["Worker"] service_worker (self)
 
str method (self)
 
typing.Optional[str] post_data (self)
 
typing.Optional[typing.Any] post_data_json (self)
 
typing.Optional[bytes] post_data_buffer (self)
 
"Frame" frame (self)
 
typing.Optional["Request"] redirected_from (self)
 
typing.Optional["Request"] redirected_to (self)
 
typing.Optional[str] failure (self)
 
ResourceTiming timing (self)
 
typing.Dict[str, str] headers (self)
 
RequestSizes sizes (self)
 
typing.Optional["Response"] response (self)
 
bool is_navigation_request (self)
 
typing.Dict[str, str] all_headers (self)
 
typing.List[NameValueheaders_array (self)
 
typing.Optional[str] header_value (self, str name)
 
- Public Member Functions inherited from playwright._impl._sync_base.SyncBase
None __init__ (self, Any impl_obj)
 
str __str__ (self)
 
None on (self, Any event, Any f)
 
None once (self, Any event, Any f)
 
None remove_listener (self, Any event, Any f)
 
- Public Member Functions inherited from playwright._impl._impl_to_api_mapping.ImplWrapper
str __repr__ (self)
 

Additional Inherited Members

- Protected Member Functions inherited from playwright._impl._sync_base.SyncBase
Any _sync (self, Union[Coroutine[Any, Any, Any], Generator[Any, Any, Any]] coro)
 
Callable[..., None] _wrap_handler (self, Union[Callable[..., Any], Any] handler)
 
- Protected Attributes inherited from playwright._impl._sync_base.SyncBase
 _dispatcher_fiber
 
 _loop
 
- Protected Attributes inherited from playwright._impl._impl_to_api_mapping.ImplWrapper
 _impl_obj
 

Member Function Documentation

◆ all_headers()

typing.Dict[str, str] playwright.sync_api._generated.Request.all_headers (   self)
Request.all_headers

An object with all the request HTTP headers associated with this request. The header names are lower-cased.

Returns
-------
Dict[str, str]

◆ failure()

typing.Optional[str] playwright.sync_api._generated.Request.failure (   self)
Request.failure

The method returns `null` unless this request has failed, as reported by `requestfailed` event.

**Usage**

Example of logging of all the failed requests:

```py
page.on(\"requestfailed\", lambda request: print(request.url + \" \" + request.failure))
```

Returns
-------
Union[str, None]

◆ frame()

"Frame" playwright.sync_api._generated.Request.frame (   self)
Request.frame

Returns the `Frame` that initiated this request.

**Usage**

```py
frame_url = request.frame.url
```

**Details**

Note that in some cases the frame is not available, and this method will throw.
- When request originates in the Service Worker. You can use `request.serviceWorker()` to check that.
- When navigation request is issued before the corresponding frame is created. You can use
  `request.is_navigation_request()` to check that.

Here is an example that handles all the cases:

Returns
-------
Frame

◆ header_value()

typing.Optional[str] playwright.sync_api._generated.Request.header_value (   self,
str  name 
)
Request.header_value

Returns the value of the header matching the name. The name is case-insensitive.

Parameters
----------
name : str
    Name of the header.

Returns
-------
Union[str, None]

◆ headers()

typing.Dict[str, str] playwright.sync_api._generated.Request.headers (   self)
Request.headers

An object with the request HTTP headers. The header names are lower-cased. Note that this method does not return
security-related headers, including cookie-related ones. You can use `request.all_headers()` for complete
list of headers that include `cookie` information.

Returns
-------
Dict[str, str]

◆ headers_array()

typing.List[NameValue] playwright.sync_api._generated.Request.headers_array (   self)
Request.headers_array

An array with all the request HTTP headers associated with this request. Unlike `request.all_headers()`,
header names are NOT lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple
times.

Returns
-------
List[{name: str, value: str}]

◆ is_navigation_request()

bool playwright.sync_api._generated.Request.is_navigation_request (   self)
Request.is_navigation_request

Whether this request is driving frame's navigation.

Some navigation requests are issued before the corresponding frame is created, and therefore do not have
`request.frame()` available.

Returns
-------
bool

◆ method()

str playwright.sync_api._generated.Request.method (   self)
Request.method

Request's method (GET, POST, etc.)

Returns
-------
str

◆ post_data()

typing.Optional[str] playwright.sync_api._generated.Request.post_data (   self)
Request.post_data

Request's post body, if any.

Returns
-------
Union[str, None]

◆ post_data_buffer()

typing.Optional[bytes] playwright.sync_api._generated.Request.post_data_buffer (   self)
Request.post_data_buffer

Request's post body in a binary form, if any.

Returns
-------
Union[bytes, None]

◆ post_data_json()

typing.Optional[typing.Any] playwright.sync_api._generated.Request.post_data_json (   self)
Request.post_data_json

Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.

When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.
Otherwise it will be parsed as JSON.

Returns
-------
Union[Any, None]

◆ redirected_from()

typing.Optional["Request"] playwright.sync_api._generated.Request.redirected_from (   self)
Request.redirected_from

Request that was redirected by the server to this one, if any.

When the server responds with a redirect, Playwright creates a new `Request` object. The two requests are connected
by `redirectedFrom()` and `redirectedTo()` methods. When multiple server redirects has happened, it is possible to
construct the whole redirect chain by repeatedly calling `redirectedFrom()`.

**Usage**

For example, if the website `http://example.com` redirects to `https://example.com`:

```py
response = page.goto(\"http://example.com\")
print(response.request.redirected_from.url) # \"http://example.com\"
```

If the website `https://google.com` has no redirects:

```py
response = page.goto(\"https://google.com\")
print(response.request.redirected_from) # None
```

Returns
-------
Union[Request, None]

◆ redirected_to()

typing.Optional["Request"] playwright.sync_api._generated.Request.redirected_to (   self)
Request.redirected_to

New request issued by the browser if the server responded with redirect.

**Usage**

This method is the opposite of `request.redirected_from()`:

```py
assert request.redirected_from.redirected_to == request
```

Returns
-------
Union[Request, None]

◆ resource_type()

str playwright.sync_api._generated.Request.resource_type (   self)
Request.resource_type

Contains the request's resource type as it was perceived by the rendering engine. ResourceType will be one of the
following: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`,
`eventsource`, `websocket`, `manifest`, `other`.

Returns
-------
str

◆ response()

typing.Optional["Response"] playwright.sync_api._generated.Request.response (   self)
Request.response

Returns the matching `Response` object, or `null` if the response was not received due to error.

Returns
-------
Union[Response, None]

◆ service_worker()

typing.Optional["Worker"] playwright.sync_api._generated.Request.service_worker (   self)
Request.service_worker

The Service `Worker` that is performing the request.

**Details**

This method is Chromium only. It's safe to call when using other browsers, but it will always be `null`.

Requests originated in a Service Worker do not have a `request.frame()` available.

Returns
-------
Union[Worker, None]

◆ sizes()

RequestSizes playwright.sync_api._generated.Request.sizes (   self)
Request.sizes

Returns resource size information for given request.

Returns
-------
{requestBodySize: int, requestHeadersSize: int, responseBodySize: int, responseHeadersSize: int}

◆ timing()

ResourceTiming playwright.sync_api._generated.Request.timing (   self)
Request.timing

Returns resource timing information for given request. Most of the timing values become available upon the
response, `responseEnd` becomes available when request finishes. Find more information at
[Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).

**Usage**

```py
with page.expect_event(\"requestfinished\") as request_info:
    page.goto(\"http://example.com\")
request = request_info.value
print(request.timing)
```

Returns
-------
{startTime: float, domainLookupStart: float, domainLookupEnd: float, connectStart: float, secureConnectionStart: float, connectEnd: float, requestStart: float, responseStart: float, responseEnd: float}

◆ url()

str playwright.sync_api._generated.Request.url (   self)
Request.url

URL of the request.

Returns
-------
str

The documentation for this class was generated from the following file: