Why is my script returning http response 400? I'm trying to create a program that would log me in to a site with proxy and save cookies using httplib. Here is a part of my code.
Code:
import httplib, urllib

#username and password
uname = 'myusername'
pword = 'mypassword'


proxy= u'myproxy.com'
port= 8080


conn = httplib.HTTPConnection(proxy, port)

conn.debuglevel=1

# first request always returns nothing.
conn.request('POST', u'1.0.0.172')

conn.close()

conn.connect()

params = urllib.urlencode({ 'user' : uname, 'pass' : pword })

headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain" }

conn.request("POST", "mywebsite.com/login.php?", params, headers)

response = conn.getresponse()

j = response.read()
print j
i got the code somewhere in the site. Any idea how to fix this? Thanks in advance.