开发者

Passing data to j_security_check with python

I have a j_security_check page on a server, and I need to pass data to it. I use Python urllib2 module, sending POST-request with j_username and j_password as parameters. The problem is that I have HTTPError 408 as a response: "The time allowed for the login process has bee开发者_运维问答n exceeded". What should I do with it?


You could try GETing the login page first and storing the cookie. This j_security_check-thingie looks like acegi security stuff.

import urllib, urllib2

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor)
urllib2.install_opener(opener)
urllib2.urlopen('http://server/login_form/')
urllib2.urlopen('http://server/j_security_check',
 data=urllib.urlencode({'j_username':'scott','j_password':'wombat'}))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜