AW: AW: [Zope] POST with Content-Type : text/plain fails

Krone, Armin armin.krone@telecash.de
Wed, 10 Oct 2001 13:34:22 +0200


> 
> "Krone, Armin" wrote:
> >
> > The pain is, that I can't change the 'content-Type' within my external
> > server.
> > What can I do with Zope that it accepts HTML-Requests with 'Content-Type
:
> > text/plain?
> 
> Hannu wrote
> There is no such thing as text/plain content type for post request.
> 
> What is the _real_ content type (format) of your external server ?
> 
> Zope needs to know it in order to extract the data that is POSTed.
> 
> The _real_ content type is plain text! The paramenters come in the
mime-body
> as
> name1=value
> name2=value

And how should Zope figure that out ;) 

Do you know any server that does enything reasonable with the encoding
you posted ?

To make Zope server believe that content-type text/plain means the
encoding 
you described you can probably hack lib/python/ZPublisher/Client.py
around lines 
180-200 to accept extra encodings in addition to standard encodings 
multipart/form-data and application/x-www-form-urlencoded.

I think you're right. This format seems to be used for e-mails (RFC2646).
I'll try to add this mime-type to the decoding module. But it seems more to
be in cgi.py because this module checks the content-type.

Armin