0

我正在尝试使用 python请求库获取口袋请求令牌并收到 400 错误。我也尝试过使用邮递员 REST Client 并得到相同的结果。对我做错了什么有任何想法吗?

这是python片段

def PocketAuth():
    params ={
        'consumer_key':'34863-11080497suck197443sdfsd342',
        'redirect_uri':'pocketapp1234:authorizationFinished'
    }
    pocketOAuth = requests.get("https://getpocket.com/v3/oauth/request", params=params)
    print(pocketOAuth.url,pocketOAuth.json)
4

1 回答 1

0

这就是我在查找错误后解决它的方法。content-header 应声明为 json。

headers = {"content-type": "application/json"}
params ={
    'consumer_key':'34863-11080497bbeded19744312c9',
    'redirect_uri':'pocketapp1234:authorizationFinished'
}
pocketOAuth = requests.get("https://getpocket.com/v3/oauth/request", data=json.dumps(params), headers=headers)
code =pocketOAuth.text
于 2015-01-12T06:31:25.983 回答