Python V5 Headers

Lately I have been using v3 and I want to move over to v5. I can’t quite figure out the header structure for using requests. I was wondering if anyone could help me out. So far I know this format:

req.get(‘api_call’, params={‘client_id’:‘client_id’})

But I’m not sure what the key name for this is:

Accept: application/vnd.twitchtv.v5+json

Assuming that you are using the requests library, you can add the headers keyword argument to the .get call (or any of the method calls) to add custom headers to the request.

ex: req.get('api_call', params={'client_id':'client_id'}, headers={'Accept':'application/vnd.twitchtv.v5+json'})

Thank you I can’t believe I didn’t notice to make the parameter for the dictionary headers instead of putting it with params.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.