'Converting HTTP Stream to Websocket Connection
I am having a hard time understanding how HTTP Streams work. I am currently experimenting with the Oanda streaming API, but having a hard time understanding how i will go about converting this request to a websocket.
headers = {'Content-Type': 'application/json',
"Authorization": "Bearer my_token"}
# Streaming prices
baseurl = 'https://stream-fxpractice.oanda.com/v3/accounts/account_id/pricing/stream'
payload = { 'instruments' : 'EUR_USD'}
r = requests.get(baseurl, params=payload, headers=headers, stream=True)
How does a request stream like this differ from a websocket? And how will i go about converting one to the other?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
