Help with a HTTP GET request
usernet at ilthio.net
Wed May 13 05:12:40 CEST 2009
On 2009-05-13, Paul Hemans <p_hemans at hotmail.com> wrote:
Note the entire URL.
> So I am trying httplib I have encoded the GET request with urllib.quote
urllib would be much easier if you don't need low level control -- it will
automatically call httplib for you.
>>>> conn = httplib.HTTPConnection("localhost")
>>>> print x
>>>> this = conn.putrequest("GET",x)
For one, x does not contain the entire request.
"/common/foxisapi.dll/tmsmail.x2.isapi?" Should also be part of the
request; otherwise, the server doesn't know which script to call. Your
script is requesting the QUERY_STRING instead of requesting the proper
script and handing the QUERY_STRING to it. The report you are getting back
is likely your default top level script minus any rewrites or redirection.
If you just need the content of the request, then I suggest using urllib:
url = "http://localhost/common/foxisapi.dll/tmsmail.x2.isapi?<PROCESS%20sync=''%20schema=''%20class='replicateApplication.getChanges'%20/"
content = urllib.urlopen(url).read()
More information about the Python-list