Pythonclient uses the code from httppost to the server for your reference.
The code is as follows:
Import urllib, httplib
Import utils
Import json
Class User:
Def _ init _ (self ):
Print 'A'
Def login (self, imsi, ua ):
Print "================= user start login ================================"
Input = {
"Method": "user. login ",
"UserName ":"",
"UserPass ":"",
}
Input ["sig"] = utils. getSignature (input)
Params = urllib. urlencode (input)
Headers = {
"User-agent": ua,
"Appstore-clientType": "android ",
"Appstore-IMEI": "123456789000000 ",
"Appstore-IMSI": imsi
}
Try:
Connection = httplib. HTTPConnection (utils. API_HOST)
Connection. request ("POST", "/api", params, headers)
Response = connection. getresponse (). read ()
# Print "========" + response
Connection. close ()
Except t Exception, e:
Print "=" + str (e)
If "errorcode" in response or response is None:
Return
Results = json. loads (response)
Return results ["results"]. encode ("UTF-8 ")