this is the code that is used to send the request from the api library :
kwargs = _get_kwargs(
client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
)
response = httpx.request(
verify=client.verify_ssl,
**kwargs,
)
I suppose we should pass a cookies or a token and not the client object to the request. But I'm not sure how it should work
maybe pass something like this to the httpsw.request :
headers=client.get_headers()
edit : ok this is already done :
def _get_kwargs(
*,
client: AuthenticatedClient,
form_data: LibraryFollowRequest,
multipart_data: LibraryFollowRequest,
json_body: LibraryFollowRequest,
) -> Dict[str, Any]:
url = "{}/api/v1/federation/follows/library/".format(client.base_url)
headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
json_body.to_dict()
multipart_data.to_multipart()
return {
"method": "post",
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"data": form_data.to_dict(),
}