0
我簡直無法得到這個工作。使用請求發佈到pastebin API
header = {"Content-Type": "application/json; charset=utf8"}
params = {"api_dev_key": dev_key, "api_user_name": username, "api_user_password": password}
req = requests.post("http://pastebin.com/api/api_login.php", params = json.dumps(params), headers = header)
print(req.status_code, req.reason, req.text)
變量(我的憑據)只是字符串。 響應我得到:
(200, 'OK',u'Bad API請求,無效api_dev_key')
有沒有錯鍵,這個帖子的時候我用https://www.hurl.it工作正常