> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# atoti.Client.http_client

#### *property* Client.http\_client *: Client*

The [httpx.Client](https://www.python-httpx.org/api/#client) to communicate with Atoti Server.

<Tip>
  It is recommended to use this client instead of reimplementing Atoti Server specific concerns like authentication and error handling with another library such as **AIOHTTP** or **requests**.
</Tip>

### Example

Pinging the server:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> path = f"{session.client.get_path_and_version_id('activeviam/pivot')[0]}/ping"
>>> path
'activeviam/pivot/rest/v10/ping'
>>> session.client.http_client.get(path).raise_for_status().text
'pong'
```

If the server returns an error as a JSON response containing a stack trace, the raised Python exception’s message will be set to that stack trace:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> path = f"{session.client.get_path_and_version_id('activeviam/pivot')[0]}/cube/query/mdx"
>>> response = session.client.http_client.post(
...     path, json={"mdx": "Some invalid MDX"}
... )
>>> response.raise_for_status()  
Traceback (most recent call last):
  ...
httpx.HTTPStatusError: com.activeviam.tech.core.api.exceptions.service.BadArgumentException: [400] The provided MDX query is invalid.
...
Caused by: ...: Some invalid MDX
...
Caused by: ...: Parser failure: ...
>>> sorted(response.json().keys())
['errorChain', 'stackTrace']
```
