pythonrequestpastebin

pastebin api : invalid api_dev_key


I'm trying to paste from my python script using following snippet:

import requests
API_ENDPOINT = "http://pastebin.com/api/api_post.php"

data = {'api_dev_key':'my key',
        'api_option': 'paste',
        'api_paste_code': 'hola',
        'api_paste_expire_date':'10M'
}


r = requests.post(url = API_ENDPOINT, data = data)
print(r)
print(r.text)

Which worked well after a few days, but now it returns bad request, invalid api_dev_key. I can't find where is the problem and I tried with another account's key.


Solution

  • Try changing the HTTP to HTTPS, i think that should do it!