Skip to content

request

Request a response from the underlying `httpx.AsyncClient` client.

Method of TikTokHTTPClient.

Request a response from the underlying httpx.AsyncClient client.

async def request(
url: str,
method: str,
http_client: Optional[httpx.AsyncClient] = None,
extra_params: Optional[Dict] = None,
extra_headers: Optional[Dict] = None,
base_params: bool = True,
base_headers: bool = True,
sign_url: bool = False,
sign_url_method: Optional[str] = None,
sign_url_type: Optional[Literal['xhr', 'fetch']] = None,
**kwargs,
) -> httpx.Response
  • url (str) — The URL to request
  • method (str) — The HTTP method to use
  • http_client (Optional[httpx.AsyncClient], default None) — An optional override for the httpx.AsyncClient client
  • extra_params (Optional[Dict], default None) — Extra parameters to append to the globals
  • extra_headers (Optional[Dict], default None) — Extra headers to append to the globals
  • base_params (bool, default True) — Whether to include the base params
  • base_headers (bool, default True) — Whether to include the base headers
  • sign_url (bool, default False) — Whether to sign the URL before requesting
  • sign_url_method (Optional[str], default None) — The HTTP method to sign with
  • sign_url_type (Optional[Literal['xhr', 'fetch']], default None) — The type of signing to use
  • **kwargs — Optional keywords for the httpx.AsyncClient.get method

httpx.Response — An httpx.Response object

from TikTokLive.client.web.web_base import TikTokHTTPClient

TikTokLive/client/web/web_base.py:264