https and POST method

L

Lorenzo Stella

Hi all,
I'm trying to write a simple script for sending sms via vyke... I have
to make a https
connection and pass some data with the POST method, like this perl
script does:

http://www.nutella.org/vyke.sms.txt

I tried to make the same, but it simply doesn't work! Any request
gives a 200 OK result... This is my code:

datah = {"act": "menulogin", "username": login, "password": passwd,
"menu_login_form": 1}
datas = urllib.urlencode(datah)
conn = httplib.HTTPSConnection("www.vyke.com")
conn.connect()
conn.request("POST", "/merchantsite/login.c?Distributor=MASKINA",
datas)
res = conn.getresponse()
print "login", res.status, res.reason
datah = {"act": "sendSMS", "from": numfrom, "to": numto, "message":
msg, "sms_form": 1}
datas = urllib.urlencode(datah)
conn.request("POST", "/merchantsite/sms.c", datas)
res = conn.getresponse()
print "send", res.status, res.reason
conn.request("GET", "/merchantsite/logout.c?Distributor=MASKINA")
res = conn.getresponse()
print "logout", res.status, res.reason
conn.close()

I don't know what to do! :-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top