build_request
BUILD a request to call the httpx client
Method of TikTokHTTPClient.
BUILD a request to call the httpx client
Signature
Section titled “Signature”async def build_request( url: str | URL, method: str, httpx_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, sign_url_payload: Optional[str] = None, **kwargs,) -> httpx.RequestParameters
Section titled “Parameters”url(str | URL) — The URL to requestmethod(str) — The HTTP method to usehttpx_client(Optional[httpx.AsyncClient], defaultNone) — An optional override for thehttpx.AsyncClientclientextra_params(Optional[Dict], defaultNone) — Extra parameters to append to the globalsextra_headers(Optional[Dict], defaultNone) — Extra headers to append to the globalsbase_params(bool, defaultTrue) — Whether to include the base paramsbase_headers(bool, defaultTrue) — Whether to include the base headerssign_url(bool, defaultFalse) — Whether to sign the URL before requestingsign_url_method(Optional[str], defaultNone) — The HTTP method to sign withsign_url_type(Optional[Literal['xhr', 'fetch']], defaultNone) — The type of signing to usesign_url_payload(Optional[str], defaultNone) — The payload to use for signing**kwargs— Optional keywords for thehttpx.AsyncClient.getmethod
Returns
Section titled “Returns”httpx.Request — An httpx.Response object
Import
Section titled “Import”from TikTokLive.client.web.web_base import TikTokHTTPClient