【发布时间】:2019-06-27 01:19:18
【问题描述】:
尝试将多个标头放入我的 GET 请求时出现语法错误。
我尝试将 Content-Type 和 Authorization 周围的 '' 更改为 "",因为我在这里看到过涉及两者的帖子,但似乎都不起作用。这是我的代码。
import json
import requests
url = 'https://api.website.com/testpost'
headers = {
'Content-type': 'application/json'
'Authorization': 'Bearer placeholdertoken'
}
response= requests.get(url, headers=headers)
print(response)
我应该得到答案,但在授权后我在“:”处收到语法错误
【问题讨论】:
标签: python json python-3.x api python-requests