I am having some problems with python. If I use IE to POST data to a page using a simple form, I get the following

POST /automa/auth.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Referer: http://maroon5/automa/login.php
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: maroon5
Content-Length: 44
Connection: Keep-Alive
Cache-Control: no-cache

HTTP/1.1 200 OK
Date: Wed, 01 Apr 2009 20:32:59 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Content-Length: 355
Connection: close
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Automa - Form Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<body>Data is jchaney and n0p@ss</body>

But if I try the samething using the following script.

"""Connect and login
import urllib
import urllib2
import httplib
params = urllib.urlencode({'fuser': 'jchaney', 'fpassword': 'n0p@ss'\
, 'submit': 'submit'})
headers = {"Content-type": "application/x-www-form-urlencoded",\
"Accept": "text/plain"}
conn = httplib.HTTPConnection('')
conn.request("POST", "automa/auth.php", params, headers)
response = conn.getresponse()
print response.status, response.reason
data = response.read()

I get a 400 Bad Request fault, see dump.

POST automa/auth.php HTTP/1.1
Accept-Encoding: identity
Content-Length: 46
Content-type: application/x-www-form-urlencoded
Accept: text/plain

HTTP/1.1 400 Bad Request
Date: Wed, 01 Apr 2009 20:18:27 GMT
Server: Apache/2.2.9 (Fedora)
Content-Length: 303
Connection: close
Content-Type: text/html; charset=iso-8859-1
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
<address>Apache/2.2.9 (Fedora) Server at Port 80</address>

I am not sure what I am doing wrong in my code.
Thank you for any ideas.

The passwords are fake and the system is intraneted, no external connections to the test box. Thank you for the concern though.

More information about error.
I set the httpd.conf error logging to debug and re-ran the script.
Results were:
[error] [client] Invalid URI in request POST automa/auth.php HTTP/1.1, referer:

Is there something special in the header that I am missing?

This question has already been answered. Start a new discussion instead.