How do I set the content-type for POST requests in python-requests library?

后端 未结 1 899
无人及你
无人及你 2020-12-15 17:41

One API I\'m currently using specifies that I need a special content-type string. I don\'t know how do I set this in python-requests library

相关标签:
1条回答
  • 2020-12-15 18:17
    import requests
    
    headers = {'Content-type': 'content_type_value'}
    r = requests.get(url, headers=headers)
    
    0 讨论(0)
提交回复
热议问题