0

curl https://api.box.com/2.0/folders/0 -H "Authorization: BoxAuth api_key=API_KEY&auth_token=AUTH_TOKEN"

这工作并返回完全符合我的期望。

request = urllib2.Request("https://api.box.com/2.0/folders/0")
request.addheaders = [("Authorization: BoxAuth", "api_key="+apikey+"&auth_token="+auth_token)]
response = urllib2.urlopen(request)

这不会并返回 401 错误。(PYTHON)

4

1 回答 1

2

它应该是:

request.add_header("Authorization", "BoxAuth api_key="+apikey+"&auth_token="+auth_token)
于 2012-10-17T03:37:21.840 回答