-- name.
data FormData
= FormData {
+ -- | @'Nothing'@ for non-file values.
fdFileName ∷ !(Maybe Text)
+ -- | MIME Type of this value, defaulted to \"text/plain\".
, fdMIMEType ∷ !MIMEType
+ -- | The form value.
, fdContent ∷ !(LS.ByteString)
}
-- limitations:
--
-- * Multiple files embedded as \"multipart/mixed\" within the
--- \"multipart/form-data\" aren't decomposed.
+-- \"multipart/form-data\" won't be decomposed.
--
--- * \"Content-Transfer-Encoding\"s are always ignored.
+-- * \"Content-Transfer-Encoding\" is always ignored.
--
-- * RFC 2388 says that non-ASCII field names are encoded according
-- to the method in RFC 2047
--- <http://www.faqs.org/rfcs/rfc2047.html>, but they aren't
+-- <http://www.faqs.org/rfcs/rfc2047.html>, but they won't be
-- decoded.
parseMultipartFormData ∷ Ascii -- ^boundary
→ LS.ByteString -- ^input
-- automatically completes it depending on the status code. (To be
-- exact, such completion only occurs when the 'Resource' transits
-- to this state without even declaring the \"Content-Type\" header
--- field. See 'setContentType'.)
+-- field. See: 'setContentType')
--
-- [/Done/] Everything is over. A 'Resource' can do nothing for the
-- HTTP interaction anymore.
-- |This is an analogy of CGI PATH_INFO. 'getPathInfo' always returns
-- @[]@ if the corresponding
--- 'Network.HTTP.Lucu.Resource.Tree.ResourceDef' is not greedy. See
--- 'getResourcePath'.
+-- 'Network.HTTP.Lucu.Resource.Tree.ResourceDef' is not greedy. See:
+-- 'getResourcePath'
--
-- Note that the returned path components are URI-decoded.
getPathInfo ∷ Resource [Strict.ByteString]
-- with \"400 Bad Request\".
--
-- Note that there are currently a few limitations on parsing
--- @multipart/form-data@. See 'parseMultipartFormData'
+-- @multipart/form-data@. See: 'parseMultipartFormData'
getForm ∷ Maybe Int → Resource [(Strict.ByteString, FormData)]
getForm limit
= do cTypeM ← getContentType
-- |Write a chunk in 'Strict.ByteString' to the response body. You
-- must first declare the response header \"Content-Type\" before
--- applying this function. See 'setContentType'.
+-- applying this function. See: 'setContentType'
putChunk ∷ Strict.ByteString → Resource ()
putChunk = putBuilder ∘ BB.fromByteString
-- can be safely applied to an infinitely long 'Lazy.ByteString'.
--
-- Note that you must first declare the response header
--- \"Content-Type\" before applying this function. See
--- 'setContentType'.
+-- \"Content-Type\" before applying this function. See:
+-- 'setContentType'
putChunks ∷ Lazy.ByteString → Resource ()
putChunks = putBuilder ∘ BB.fromLazyByteString