Объект 'str' не имеет атрибута 'get_httpx_client'Python

Программы на Python
Anonymous
Объект 'str' не имеет атрибута 'get_httpx_client'

Сообщение Anonymous »


I am trying to access a specific endpoint in my REST API, one of my modules is passing a client URI into a module.sync_detailed (client, device). However, I get

AttributeError: 'str' object has no attribute 'get_httpx_client'

My code looks like

with client as client: my_data: MyDataModel = get_my_data_model.sync(client=client) # or if you need more info (e.g. status_code) response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client, device=device) the sync_detailed function looks like this

def sync_detailed( *, client: Union[AuthenticatedClient, Client], device_id: str, ) -> Response[Any]: kwargs = _get_kwargs( device_id=device_id, ) response = client.get_httpx_client().request( **kwargs, ) return _build_response(client=client, response=response) I tried to check the type for client using print(type(client)) and got


Источник: https://stackoverflow.com/questions/780 ... tpx-client

Вернуться в «Python»