cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl to login with POST and redirect

From: LoD MoD <lodmod.dod_at_gmail.com>
Date: Mon, 21 Sep 2009 12:00:35 -0700

I am trying to access a page that requires authentication. It first
does a POST to log in and then requests the page. I am getting the
login page as a response, so I think my command is formed improperly.
Any help is appreciated.

Here is the curl command:
curl -d 'j_character_encoding=UTF-8&j_password=password&j_username=weblogic'
-L http://myweblogicserver:7001/console/console.portal?_nfpb=true&_pageLabel=WebAppModuleMonitorPage&WebAppMonitorRunningPortlethandle=com.bea.console.handles.ModuleHandle%28%22com.bea%3AName%3DMyEAR2%2CType%3DAppDeployment%3Bpublish%3B%2F%3B%3Cnone%3E%3BWEBAPP%22%29"

here is the POST data on a successful login using Firebug:
j_character_encodingUTF-8
j_password password
j_username weblogic
The response I get is the login page, without a successful authentication.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-09-21