How to use python urllib2 to send json data for login -


i want use python urllib2 simulate login action, use fiddler catch packets , got login action ajax request , username , password sent json data, have no idea how use urllib2 send json data, help...

import urllib2 import json # whatever structure need send goes here: jdata = json.dumps({"username":"...", "password":"..."}) urllib2.urlopen("http://www.example.com/", jdata) 

this assumes you're using http post send simple json object username , password.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -