cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: HTTPs POST - always get 500 error code

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Mon, 16 Apr 2007 15:19:53 -0500

On 4/16/07, Cheok Yan Cheng <yccheok_at_yahoo.com> wrote:
> Hello all, I try to perform HTTPs POST by using curl
> tool.
>
> The following web site is the one which I am perform
> https://www.osk188.com/login.jsp?continue=%2Fquotes.jsp
>
> When I provide correct username n password, I am able
> to login to the web site with no problem.
>
> Then, I try to login by using curl. I study the HTML
> code, I found out the form is consists of the
> following fields (Please correct me if I were wrong)
>
> txtUserName=
> txtPassword=
> continue=%2Fquotes.jsp
> sessionError=0
> action2=Login
> action=Sign%20Up%20Now
> Submit2=Forget%20Login%20Password
>
> After analysis, I try to invoke curl using the
> following command
>
> curl -e
> https://www.osk188.com/login.jsp?continue=%2Fquotes.jsp
> -d
> "txtUserName=myusername&txtPassword=mypassword&continue=%2Fquotes.jsp&sessionError=0&action2=Login&action=Sign%20Up%20Now&Submit2=Forget%20Login%20Password"
> https://www.osk188.com/dologin.jsp
>
>
> ** please note that i didn't post the actual username
> and password for secuirity purpose.
>
> However, I just keep getting HTTP Status 500
>
> I am pretty sure that I am supplying correct password
> and username. This is because if I purposely change to
> wrong username and password, I will get nothing.
>
> Can anyone please advice, how I can get exactly the
> same behavior, as what I get in normal web browser?
> Anything I have missing?

I don't think you should be sending the "Submit2" variable. If you
look at the page source, that button has an onClick action that does

   location.href='page.jsp?name=forgetPassword'

which would make a browser immediately take you to a different page.
Similarly with "action" - that's a button that pops up a new window
for a new user to register.

You definitely need to try something like LiveHTTPHeaders and find out
for sure what gets sent.

Ralph Mitchell
Received on 2007-04-16