I have a question about how to connect using Python and requests library to CH Streaming API. I don’t think that chwrapper package can help with the access to the Streaming API.
Adding this on this thread because dean_mcginn mentioned that someone else was mixing up streaming API with the REST one. Plus title of this post does not say that the original question was only about REST API.
I removed my_api_key from the code because I want to keep my key save. I did take the steam key and not the rest the 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.