File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,32 @@ SERVICE_URL = 'http://services.odata.org/V2/Northwind/Northwind.svc/'
1212client = pyodata.Client(SERVICE_URL , requests.Session())
1313```
1414
15+ ### Get the service proxy client for an OData service requiring authentication
16+
17+ Let's assume you need to work with a service at
18+ the URL ` https://odata.example.com/Secret.svc ` and User ID is 'MyUser' with
19+ the password 'MyPassword'.
20+
21+ PyOData expects that the used HTTP library will take care about this task.
22+
23+ In this example we configure
24+ [ Session] ( https://2.python-requests.org/en/master/user/advanced/#session-objects ) of
25+ [ python-requests] ( https://2.python-requests.org/en/master/ ) to handle
26+ user authentication.
27+
28+ ``` python
29+ import requests
30+ import pyodata
31+
32+ SERVICE_URL = ' https://odata.example.com/Secret.svc'
33+
34+ session = requests.Session()
35+ session.auth = (' MyUser' , ' MyPassword' )
36+
37+ # Create instance of OData client
38+ client = pyodata.Client(SERVICE_URL , session)
39+ ```
40+
1541### Get one entity identified by its key value
1642
1743``` python
You can’t perform that action at this time.
0 commit comments