HTTP client for interacting with the various APIs
Signature
Section titled “Signature”class TikTokHTTPClient
TikTokHTTPClient( web_proxy: Optional[Proxy] = None, httpx_kwargs: Optional[dict] = None, signer_kwargs: Optional[dict] = None,)Create an HTTP client for interacting with the various APIs
Parameters
Section titled “Parameters”web_proxy(Optional[Proxy], defaultNone) — An optional proxy for the HTTP clienthttpx_kwargs(Optional[dict], defaultNone) — Additional httpx kwargssigner_kwargs(Optional[dict], defaultNone) — Additional signer kwargs
Attributes
Section titled “Attributes”httpx_client(property,AsyncClient) — Get the underlyinghttpx.AsyncClientinstancesigner(property,TikTokSigner) — Get the TikTok signer for the HTTP client
Methods
Section titled “Methods”close()— Close the HTTP client gracefullyset_session()— Set the session id cookies for the HTTP client and Websocket connectiongenerate_device_id()— Generate a spoofed device ID for the TikTok API callbuild_url()build_request()— BUILD a request to call the httpx clientrequest()— Request a response from the underlyinghttpx.AsyncClientclient.get()post()
Import
Section titled “Import”from TikTokLive.client.web.web_base import TikTokHTTPClient