curl-users
Re: cURL form post problem?
Date: Tue, 30 Nov 2004 14:52:02 +0100 (CET)
On Tue, 30 Nov 2004, William West wrote:
> curl -d "SearchTerm=Roshanak%20Semnani"
> http://ned.nih.gov/view_search_results.asp
> OR
> curl -F "SearchTerm=Roshanak%20Semnani"
> http://ned.nih.gov/view_search_results.asp
You don't just try -d or -F, you can easily read the HTML to figure out which
method to use. As the docs explains.
> Is there something unusual about the way this form was created that is
> preventing cURL from working properly?
No. But forms generally contain many fields and you generally need to specify
most or all of them.
> The web browser start page is http://ned.nih.gov/. When I enter "Roshanak
> Semnani" in the search field, I get 1 record.
When I do that with my browser, LiveHTTPheaders records this POST data:
DirStatus=&SecSrchValHidden=&Email=&Firstname=Roshanak&Lastname=Semnani&IndvUID=&AmbiguousName=&PrivilegedUser=&SearchTerm=Roshanak+Semnani&ICID=-1
... and it also provides a cookie.
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.htmlReceived on 2004-11-30