Doesn't work (was: Re: httplib won't accept URL with parameters (???))

Andrew McGregor andrew at indranet.co.nz
Sun Jan 12 23:56:19 EST 2003


The reason appears to be that you got a 302, which is a redirect.  You then 
have to parse the response and figure out the real URL, which wget and your 
browser are doing for you.

HTTPConnection is probably easier to support this with, because the 
response is given back in a HTTPResponse object already partly parsed.

That the library do redirects (possibly not by default) should probably be 
a feature request.

Andrew

--On Monday, January 13, 2003 02:47:15 +0100 Phillip <ritschratsch at gmx.de> 
wrote:

> pythonhda schrieb:
>> On Fri, 10 Jan 2003 01:20:16 +0100
>> Phillip <ritschratsch at gmx.de> wrote:
>>
>> ...
>>
>>
>>> > and then use the >HTTPConnection class becuase that is
>>> > what is in use now.
>>>
>>> I don't quite get the documentation on how I'm supposed to tackle this.
>>> HTTPConnection has different parameters (3 instead of 2) and some other
>>> issues that aren't *that* well dosumented. From what I gather I just
>>> can't change the constructor and be done with it....
>>> A, well, we'll see.
>>>
>>
>>
>> I don't quite understand what you mean. You didn't change the contructor
>
> No. But just chaning it won't make it work with HTTPConnect either.
> I'dhave to rewrite the whole class (not that it's that big... but still)
> That's all I'm saying.
>
>> in your original code. You basically wrapped procedure code into a class
>> Check section 11.6.3 in the docs (I have Python 2.2.1) I was able to
>  > reproduce what you wanted to do originally (using the examples from
>  > that section) in about 7 lines of code.
>>
>> Also check out:  http://web.pydoc.org/2.2/httplib.html
>
> There is no way whatsoever that I can get it to work with what I've got!
> Wget works, so I presume that it's the parameters that are passed that
> httplib just plain can't handle. The problem is that this isn't
> documented anywhere.
> Could it be that the parameters invoke a serverresponse that is somehow
> different from a normal response to an URL and therefore isn't 'sensed'
> by httplib? When I use a any kind of Browser or wget it works! It simply
> doesn't work with httplib. One Moment please ....
> Back again.
> Just did another test. It won't work with HTTPConnection either!
> Status is: 302 reason is: Found
> What the fuck is happening that Browser and Wget take care of but httplib
> don't??? I'd really like to know. Any clue?
>
> Phillip
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>







More information about the Python-list mailing list