HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulewai-extra-3.1.16Haskell2010

Network.Wai.Parse

Some helpers for parsing data out of a raw WAI Request.

  • 7 types
  • 26 values
valueparseRequestBody :: BackEnd y -> Request -> IO ([Param], [File y])
#

Parse the body of an HTTP request. See parseRequestBodyEx for details. Note: This function does not limit the memory it allocates. When dealing with untrusted data (as is usually the case when receiving input from the internet), it is recommended to use the parseRequestBodyEx function instead.

since 3.1.15 : throws RequestParseException if something goes wrong

datadata RequestBodyType
#

The mimetype of the http body. Depending on whether just parameters or parameters and files are passed, one or the other mimetype should be used.

Constructors

valuetempFileBackEnd
  1. :: InternalState
  2. -> ignored1
  3. -> ignored2
  4. -> IO ByteString
  5. -> IO FilePath
#

Save uploaded files on disk as temporary files

Note: starting with version 2.0, removal of temp files is registered with the provided InternalState. It is the responsibility of the caller to ensure that this InternalState gets cleaned up.

A reasonable default set of parsing options. Maximum key/filename length: 32 bytes; maximum files: 10; filesize unlimited; maximum size for parameters: 64kbytes; maximum number of header lines: 32 bytes (applies only to headers of a mime/multipart message); maximum header line length: Apache's default for that is 8190 bytes (http:/httpd.apache.orgdocs2.2mod/core.html#limitrequestline) so we're using that here as well.

Parse the body of an HTTP request, limit resource usage. The HTTP body can contain both parameters and files. This function will return a list of key,value pairs for all parameters, and a list of key,a pairs for filenames. The a depends on the used backend that is responsible for storing the received files.

since 3.1.15 : throws RequestParseException if something goes wrong