curl-users
POSTing on an https site
Date: Fri, 25 Feb 2005 05:20:52 +0000
Hi,
I'm trying to access a site where I have to put a username and
password into a form and post it to the server so that I can get to
the next page. I'm pretty sure that this can be done with the '-d'
option. With this option, in the "automating HTTP jobs" page it
mentions that form may look like:
<form method="POST" action="junk.cgi">
<input type=text name="birthyear">
<input type=submit name=press value=" OK ">
</form>
and to put in a birthyear and press the button, you respond with:
curl -d "birthyear=1905&press=%20OK%20" www.hotmail.com/when/junk.cgi
well the form on the webpage that I'm trying trying to fill looks like:
<form action="https://www.dyndns.org/account/services/dyndns/doublethink.ath.cx"
method="post">
<input type="hidden" name="__login" value="1" />
<label for="username">
User: <input type="text" name="username" id="username" size="14"
value="murraypatterson" />
</label>
<label for="password">
Pass: <input type="password" name="password" id="password" size="14" />
</label>
<input type="submit" value="Login" />
</form>
so I responded similarily:
curl -d "username=murraypatterson&password=*******"
https://www.dyndns.org/account/services/dyndns/doublethink.ath.cx
the problem is that it just spits out the same html code before this
attempt as if I'd accessed the page without even trying to input the
username and password. One thing I was thinking of . . . this page
that I'm trying to access is an https site. However in the help pages
on the curl website, it says that curl supports https connections:
-------- clip from page ----------
Curl supports encrypted fetches thanks to the freely available OpenSSL
libraries. To get a page from a HTTPS server, simply run curl like:
curl https://that.secure.server.com
---------- end clip ------------------
so I can fetch this https url . . . but I am assuming I have to do all
of this extra SSL stuff in order to fill in the form am I? (like
using certificates with the '-E' option, etc.)
thanks for the help,
Murray
Received on 2005-02-25