Skip to content

Commit

Permalink
docs: add async init for initialization.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
phanak-sap committed Dec 19, 2023
1 parent 03eb916 commit 1b3f1c9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/usage/initialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ Basic initialization which is going to work for everybody:
northwind = pyodata.Client(SERVICE_URL, requests.Session())
Get the service for async libraries
-----------------------------------

Initialization of the session instance is dependent on particular library,
but also must have API compatible Session_ from Requests_.

.. code-block:: python
import httpx
import aiohttp
SERVICE_URL = 'http://services.odata.org/V2/Northwind/Northwind.svc/'
service_httpx = await pyodata.Client.build_async_client(SERVICE_URL, httpx)
service_aiohttp = await pyodata.Client.build_async_client(SERVICE_URL, aiohttp.ClientSession())
Get the service proxy client for an OData service requiring sap-client parameter
--------------------------------------------------------------------------------

Expand Down

0 comments on commit 1b3f1c9

Please sign in to comment.