[Ur] Handling POST requests that aren't from forms

Chris Double chris.double at double.co.nz
Wed Dec 15 20:26:23 EST 2010


On Thu, Dec 16, 2010 at 3:58 AM, Adam Chlipala <adamc at impredicative.com> wrote:
> If we (for the moment) treat the compiler as fixed in stone, the simplest
> approach is probably an HTTP-proxying wrapper script.  Suggestions of "the
> right way" to extend the compiler to support this stuff are also welcome.

Thanks, I'll use a proxy script in the meantime. An approach I was
thinking of was to provide a 'requestBody' function:

val requestBody : unit -> transaction blob

Can a blob be converted to a string? There would need to be a way to
do this (or have requestBody return a string). Or have some conversion
done based on a mime type (So application/json converts using
fromJSON, etc). This would allow web apps to handle the body and do
whatever they need to.

A downside is that this means the request body needs to be kept around
which could be problematic if it's large.

Chris.
-- 
http://www.bluishcoder.co.nz



More information about the Ur mailing list