HTTP error on receiving a form

Steve Holden sholden at holdenweb.com
Mon Apr 22 11:25:35 EDT 2002


<Patrick.Bussi at space.alcatel.fr> wrote in message
news:mailman.1019466221.11245.python-list at python.org...
>
> Hello
>
> I am implementing a simple tool to answer post requests for automatic
testing of
> a Web APACHE Server (implemented by other people). It is rather easy with
use of
> something like:
>
> dataOfTheForm= {"data1":"val1","data2":"val2"[...etc...]}
> encodedData=urllib.urlencode(dataOfTheForm)
> f=urllib.urlopen(webSite,encodedData)
>
> However, the web server find errors in the data received from my tool,
while all
> is OK with a web browser. I have TCPdumped answers both from my test tool
and
> from an ordinary web browser (say Mozilla). As far as I could understand,
the
> only difference is the order in which data are encoded.
>
> My questions:
>
> 1 - is it possible that a web Server be sensitive to the order in which
data are
> encoded (as they are all sent in one single IP packet)
>
This should not be a factor. It might affect things if the same name
appeared twice in the encoded data, but encoding from a dictionary more or
less explicitly ensure this won't happen.

> 2 - is there a quick way to encode data from a dictionary in a specific
order.
>
>
Not using urllib.urlencode().

I think you should be looking elsehwere for the problem, it seems rather
unlikely that sequencing is causing the error.

regards
 Steve
--

home: http://www.holdenweb.com/    book: http://pydish.holdenweb.com/pwp/







More information about the Python-list mailing list