import sys import urllib import md5 import json def run(client, session, server, args): if len(args) == 0: print "email required" return email = args[0] encoded_email = urllib.quote_plus(email) data = {} headers = {"Content-type": "application/json", "Accept": "text/plain", "Cookie": "RS_API=" + str(session)} client.request("POST", "/api/user/forgotpw/" + encoded_email, json.dumps(data), headers) #client.request("POST", "/api/user/forgotpw/" + email, json.dumps(data), headers) response = client.getresponse() print "HTTP Status/Reason: " + str(response.status) + " / " + response.reason print "Response header: " + str(response.getheaders()) print "Response:" print response.read()