I need to write a program that sends HTTP POST requests to navigate a website and retrieve data from it. I'm currently testing using the following website:
The site sends me a 400 error when sending the following request:
Is my request contstructed correctly?
The site sends me a 400 error when sending the following request:
POST /cgi-bin/mycgi.pl HTTP/1.0
Content-type: text/html
Content-Length: 209
&realname=nospaces&email=blah&nosmoke=CHECKED&hatesanchovies=UNCHECKED&shakespea
re=UNCHECKED&washesdaily=UNCHECKED&beach=UNCHECKED&brooklyn=UNCHECKED&dogs=UNCHE
CKED&cats=UNCHECKED&iguanas=UNCHECKED&myself=blah
HTTP/1.1 404 Not Found
Date: Thu, 13 Jan 2005 17:16:40 GMT
Server: Apache
Content-Length: 290
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /cgi-bin/mycgi.pl was not found on this server.</p>
<hr />
<address>Apache Server at prancer.anywherehost.net Port 80</address>
</body></html>
Is my request contstructed correctly?