[Seaside] Rest and POST method

Olivier Auverlot olivier.auverlot at gmail.com
Wed Apr 6 12:25:43 UTC 2011


I have modified the code with the following modifications :

HttpRequest>>#rawPostFields
     ^self propertyAt: #rawPostFields ifAbsentPut: [
         (self isPostRequest) ifTrue: [
             stream next: self contentLength
         ] ifFalse: [
             ''
         ].
     ]

Now, it seems ok. I can send GET or POST requests and send XML data. For 
read this data, I use the rawBody propertie.

For example:

postXML
<POST>
<Consumes: 'text/xml'>
<Path: '/postxml'>
     Transcript show: self requestContext request rawBody.

Now, I must find a cool tool for parsing XML...

Olivier ;-)
www.auverlot.fr
> 2011/4/6 Olivier Auverlot<olivier.auverlot at gmail.com>:
>> Philippe,
>>
>> I supose that the guilty is HttpRequest>>#rawPostFields.
>>
>> If #isPostRequest answers true and the content type is different of
>>   'application/x-www-form-urlencoded', it answers always ''.
> Ah, that explains it. I guess you can just remove the check
>
>   self contentType = MIMEDocument contentTypeFormData
>
> I created an issue [1]
>
>   [1] http://code.google.com/p/seaside/issues/detail?id=648
>
> Cheers
> Philippe
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list