我正在尝试使用this guide获取访问令牌。在
这是我的主要档案:import requests
from utils import make_basic_auth_header, conf
code = ''
url = "%s/identity/v1/oauth2/token" % conf('EBAY_API_PREFIX')
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': make_basic_auth_header()
}
data = {
'grant_type': 'authorization_code',
# 'grant_type': 'refresh_token',
'state': None,
'code': code,
'redirect_uri': conf('EBAY_RUNAME')
}
r = requests.post(
url,
data=data,
headers=headers,
)
这是make_basic_auth_header()函数:
^{pr2}$
但是我得到的只是:{u'error_description': u'request is missing a required parameter or malformed.', u'error': u'invalid_request'}
我很沮丧-我做错什么了?在