From b50cbd440dccae9e28afddda29674076c7cdf6ce Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 20 Dec 2010 18:55:33 +0200 Subject: [PATCH] reqRequestBody doc update --- Yesod/Request.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Yesod/Request.hs b/Yesod/Request.hs index d526ff65..48cc4236 100644 --- a/Yesod/Request.hs +++ b/Yesod/Request.hs @@ -100,6 +100,13 @@ data Request = Request -- thunk, which essentially means it will be computed once at most, but -- only if requested. This allows avoidance of the potentially costly -- parsing of POST bodies for pages which do not use them. + -- + -- Additionally, since the request body is not read until needed, you can + -- directly access the 'W.requestBody' record in 'reqWaiRequest' and + -- perform other forms of parsing. For example, when designing a web + -- service, you may want to accept JSON-encoded data. Just be aware that + -- if you do such parsing, the standard POST form parsing functions will + -- no longer work. , reqRequestBody :: IO RequestBodyContents , reqWaiRequest :: W.Request -- | Languages which the client supports.