You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created a runnable prototype for RDP HTTPX client, with a synchronous example. The example demonstrates how to authenticate and call RDP APIs using httpx in blocking mode.
The code includes comments explaining the use of `verify=False` to skip SSL verification for local/dev environments, which is not recommended for production use.
Small Python example that uses [`httpx`](https://www.python-httpx.org/) to authenticate with the Refinitiv Data Platform (RDP) OAuth2 **Password Grant** flow and call a couple of RDP REST endpoints.
Copy `src/.env.example` to `src/.env` and fill in values:
40
+
41
+
```dotenv
42
+
RDP_BASE_URL=https://api.refinitiv.com
43
+
44
+
MACHINEID_RDP=<RDP Machine-ID>
45
+
PASSWORD_RDP=<RDP Password>
46
+
APPKEY_RDP=<RDP AppKey>
47
+
```
48
+
49
+
## Run
50
+
51
+
```powershell
52
+
python .\src\example_sync_httpx.py
53
+
```
54
+
55
+
The script prints the access token (demo only), then prints the JSON responses from the sample endpoints.
56
+
57
+
## Security notes
58
+
59
+
The example uses `verify=False` in `httpx` calls, which **disables TLS certificate verification**. This is unsafe for production—remove `verify=False` (or provide a proper CA bundle) for real usage. I use it in this project to avoid LSEG beloved ZScaler.
60
+
61
+
Also avoid printing access tokens in real applications.
Copy file name to clipboardExpand all lines: src/example_sync_httpx.py
+19-13Lines changed: 19 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
+
""" Example code demonstrating how to use httpx to authenticate and call RDP APIs with the requests like interface. This is a synchronous version of the example_httpx.py file, using httpx in blocking mode. """
0 commit comments