3

我正在使用 Python python-oauth2。尝试交换我的代币时收到错误消息。这是代码片段:

consumer = oauth.Consumer(consumer_key, consumer_secret)

client = oauth.Client(consumer)

client.request(access_token_url, "POST", headers={'xoauth_oauth2_access_token':'XXXXXXXXXX'})
({'status': '400', 'content-length': '83', 'transfer-encoding': 'chunked', 'vary': 'Accept-Encoding', 'server': 'Apache-Coyote/1.1', '-content-encoding': 'gzip', 'date': 'Thu, 10 May 2012 22:28:38 GMT', 'nncoection': 'close', 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8', 'www-authenticate': 'OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="parameter_absent", oauth_parameters_absent="oauth_token%26oauth_verifier"'}, 'oauth_problem=parameter_absent&oauth_parameters_absent=oauth_token%26oauth_verifier')

收到 400 条回复:

oauth_problem="parameter_absent", oauth_parameters_absent="oauth_token%26oauth_verifier"

我无法获得 auth_verifier,因为这是 JSAPI 到 REST 的交换。我应该为通话做些什么不同的事情吗?

4

1 回答 1

0

您不会将 xoauth_oauth2_access_token 作为标头传递,而是作为查询参数传递。

于 2012-05-12T01:31:16.180 回答