get请求在postman中使用的时候,authorization中带bearer token,那么使用Python构造get请求时,该token应该怎么带入呢?
解决方法如下:
url_user = ""cookies_user = { 'id':'123455566' }#header值中加一下token#第一种方法headers = { 'Authorization': 'Basic {}'.format(token值) }#第二种方法headers = {"Authorization":"Bearer "+token值}response_user = requests.get(url_user, cookies_user,headers = headers)
试一下就可以了