![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| None | dispose (self, *typing.Optional[str] reason=None) |
| "APIResponse" | delete (self, str url, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| "APIResponse" | head (self, str url, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| "APIResponse" | get (self, str url, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| "APIResponse" | patch (self, str url, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| "APIResponse" | put (self, str url, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| "APIResponse" | post (self, str url, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| "APIResponse" | fetch (self, typing.Union[str, "Request"] url_or_request, *typing.Optional[typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str]] params=None, typing.Optional[str] method=None, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[typing.Union[typing.Any, str, bytes]] data=None, typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] form=None, typing.Optional[typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]]] multipart=None, typing.Optional[float] timeout=None, typing.Optional[bool] fail_on_status_code=None, typing.Optional[bool] ignore_https_errors=None, typing.Optional[int] max_redirects=None, typing.Optional[int] max_retries=None) |
| StorageState | storage_state (self, *typing.Optional[typing.Union[pathlib.Path, str]] path=None, typing.Optional[bool] indexed_db=None) |
Public Member Functions inherited from playwright._impl._async_base.AsyncBase | |
| 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._async_base.AsyncBase | |
| Callable[..., None] | _wrap_handler (self, Union[Callable[..., Any], Any] handler) |
Protected Attributes inherited from playwright._impl._async_base.AsyncBase | |
| _loop | |
Protected Attributes inherited from playwright._impl._impl_to_api_mapping.ImplWrapper | |
| _impl_obj | |
| "APIResponse" playwright.async_api._generated.APIRequestContext.delete | ( | self, | |
| str | url, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.delete
Sends HTTP(S) [DELETE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) request and returns its
response. The method will populate request cookies from the context and update context cookies from the response.
The method will automatically follow redirects.
Parameters
----------
url : str
Target URL.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| None playwright.async_api._generated.APIRequestContext.dispose | ( | self, | |
| *typing.Optional[str] | reason = None |
||
| ) |
APIRequestContext.dispose
All responses returned by `a_pi_request_context.get()` and similar methods are stored in the memory, so that
you can later call `a_pi_response.body()`.This method discards all its resources, calling any method on
disposed `APIRequestContext` will throw an exception.
Parameters
----------
reason : Union[str, None]
The reason to be reported to the operations interrupted by the context disposal.
| "APIResponse" playwright.async_api._generated.APIRequestContext.fetch | ( | self, | |
| typing.Union[str, "Request"] | url_or_request, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[str] | method = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.fetch
Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and
update context cookies from the response. The method will automatically follow redirects.
**Usage**
JSON objects can be passed directly to the request:
```python
data = {
\"title\": \"Book Title\",
\"body\": \"John Doe\",
}
api_request_context.fetch(\"https://example.com/api/createBook\", method=\"post\", data=data)
```
The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data`
encoding, by specifiying the `multipart` parameter:
Parameters
----------
url_or_request : Union[Request, str]
Target URL or Request to get all parameters from.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
method : Union[str, None]
If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or
[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)). If not specified, GET method is used.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| "APIResponse" playwright.async_api._generated.APIRequestContext.get | ( | self, | |
| str | url, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.get
Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its
response. The method will populate request cookies from the context and update context cookies from the response.
The method will automatically follow redirects.
**Usage**
Request parameters can be configured with `params` option, they will be serialized into the URL search parameters:
```python
query_params = {
\"isbn\": \"1234\",
\"page\": \"23\"
}
api_request_context.get(\"https://example.com/api/getText\", params=query_params)
```
Parameters
----------
url : str
Target URL.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| "APIResponse" playwright.async_api._generated.APIRequestContext.head | ( | self, | |
| str | url, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.head
Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its
response. The method will populate request cookies from the context and update context cookies from the response.
The method will automatically follow redirects.
Parameters
----------
url : str
Target URL.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| "APIResponse" playwright.async_api._generated.APIRequestContext.patch | ( | self, | |
| str | url, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.patch
Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its
response. The method will populate request cookies from the context and update context cookies from the response.
The method will automatically follow redirects.
Parameters
----------
url : str
Target URL.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| "APIResponse" playwright.async_api._generated.APIRequestContext.post | ( | self, | |
| str | url, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.post
Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its
response. The method will populate request cookies from the context and update context cookies from the response.
The method will automatically follow redirects.
**Usage**
JSON objects can be passed directly to the request:
```python
data = {
\"title\": \"Book Title\",
\"body\": \"John Doe\",
}
api_request_context.post(\"https://example.com/api/createBook\", data=data)
```
To send form data to the server use `form` option. Its value will be encoded into the request body with
`application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send
files):
The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data`
encoding. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:
```python
api_request_context.post(
\"https://example.com/api/uploadScript'\",
multipart={
\"fileField\": {
\"name\": \"f.js\",
\"mimeType\": \"text/javascript\",
\"buffer\": b\"console.log(2022);\",
},
})
```
Parameters
----------
url : str
Target URL.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| "APIResponse" playwright.async_api._generated.APIRequestContext.put | ( | self, | |
| str | url, | ||
| *typing.Optional[ typing.Union[typing.Dict[str, typing.Union[str, float, bool]], str] ] | params = None, |
||
| typing.Optional[typing.Dict[str, str]] | headers = None, |
||
| typing.Optional[typing.Union[typing.Any, str, bytes]] | data = None, |
||
| typing.Optional[typing.Dict[str, typing.Union[str, float, bool]]] | form = None, |
||
| typing.Optional[ typing.Dict[str, typing.Union[bytes, bool, float, str, FilePayload]] ] | multipart = None, |
||
| typing.Optional[float] | timeout = None, |
||
| typing.Optional[bool] | fail_on_status_code = None, |
||
| typing.Optional[bool] | ignore_https_errors = None, |
||
| typing.Optional[int] | max_redirects = None, |
||
| typing.Optional[int] | max_retries = None |
||
| ) |
APIRequestContext.put
Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its
response. The method will populate request cookies from the context and update context cookies from the response.
The method will automatically follow redirects.
Parameters
----------
url : str
Target URL.
params : Union[Dict[str, Union[bool, float, str]], str, None]
Query parameters to be sent with the URL.
headers : Union[Dict[str, str], None]
Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by
it.
data : Union[Any, bytes, str, None]
Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
header will be set to `application/octet-stream` if not explicitly set.
form : Union[Dict[str, Union[bool, float, str]], None]
Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
as this request body. If this parameter is specified `content-type` header will be set to
`application/x-www-form-urlencoded` unless explicitly provided.
multipart : Union[Dict[str, Union[bool, bytes, float, str, {name: str, mimeType: str, buffer: bytes}]], None]
Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.
timeout : Union[float, None]
Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
fail_on_status_code : Union[bool, None]
Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
codes.
ignore_https_errors : Union[bool, None]
Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
max_redirects : Union[int, None]
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
exceeded. Defaults to `20`. Pass `0` to not follow redirects.
max_retries : Union[int, None]
Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not
retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Returns
-------
APIResponse
| StorageState playwright.async_api._generated.APIRequestContext.storage_state | ( | self, | |
| *typing.Optional[typing.Union[pathlib.Path, str]] | path = None, |
||
| typing.Optional[bool] | indexed_db = None |
||
| ) |
APIRequestContext.storage_state
Returns storage state for this request context, contains current cookies and local storage snapshot if it was
passed to the constructor.
Parameters
----------
path : Union[pathlib.Path, str, None]
The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current
working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
indexed_db : Union[bool, None]
Set to `true` to include IndexedDB in the storage state snapshot.
Returns
-------
{cookies: List[{name: str, value: str, domain: str, path: str, expires: float, httpOnly: bool, secure: bool, sameSite: Union["Lax", "None", "Strict"]}], origins: List[{origin: str, localStorage: List[{name: str, value: str}]}]}