I am struggling to figure out how to connect to the CH Streaming API via Python (requests library). I went through the documentation but was not able to solve my problem with it. I was able to connect to the REST API without any issues, but not to the Streaming API
Please note that I removed my_api_key from the code because I want to keep my key save. I did take the stream key and not the REST API one.
import requests
url = 'https://stream.companieshouse.gov.uk/insolvency-cases'
headers = {'my_api_key': '***********my_api_key**********'}
r = requests.get(url, headers=headers)
print(r.text)
This results in the following error:
{“error”:“Empty Authorization header”,“type”:“ch:service”}
What am I doing wrong? Any pointer in the right direction will help. Thanks in advance.