I am trying to use the guerrillamail API located at http://api.guerrillamail.com/ajax.php, but I'm running into trouble with the "set_email_user" function, as it requires me to post arguments along with the function.
I have never worked with PHP, nor JSON, so I do not know the correct way to post arguments to a function like this.
I am using the python 2.7 library requests to make things easier.
s = requests.session()
payload = {'f':'get_email_address'}
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13'}
req2 = s.post('http://api.guerrillamail.com/ajax.php', data = payload, headers = headers)
print req2.text #prints out the current email address
payload = {'f':'set_email_user:u\'sark\''} #here is the issue. I cannot figure out how to pass a string argument into the set_email_user function
req = s.post('http://api.guerrillamail.com/ajax.php', data = payload, headers = headers, cookies = s.cookies)
print req.text
payload = {'f':'get_email_address'}
req2 = s.post('http://api.guerrillamail.com/ajax.php', data = payload, headers = headers, cookies = s.cookies)
print req2.text #prints the same email address as above