Parse the HTTP accept string to determine supported content types.
Modulewai-extra-3.1.16Haskell2010
Network.Wai.Parse
Some helpers for parsing data out of a raw WAI Request.
- 7 types
- 26 values
- Packagewai-extra-3.1.16
- Exports33
- LanguageHaskell2010
- LicenceMIT
- SourceParse.hs
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
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
UrlEncodedapplication/x-www-form-urlencoded (parameters only)
Multipart ByteStringmultipart/form-data (parameters and files)
Get the mimetype of the body of an http request.
since 3.1.15 : throws RequestParseException if something goes wrong
Throws RequestParseException if something goes wrong
since 3.1.15 : throws RequestParseException if something goes wrong
Things that could go wrong while parsing a Request
Instances3Eq, Show, Exception
Eq RequestParseExceptionDefined in wai-extra-3.1.16 · Network.Wai.ParseShow RequestParseExceptionDefined in wai-extra-3.1.16 · Network.Wai.ParseException RequestParseExceptionDefined in wai-extra-3.1.16 · Network.Wai.Parse
A file uploading backend. Takes the parameter name, file name, and a stream of data.
Store uploaded files in memory
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.
tempFileBackEndOpts :: IO FilePathget temporary directory
-> Stringfilename pattern
-> InternalState-> ignored1-> ignored2-> IO ByteString-> IO FilePath
Same as tempFileBackEnd, but use configurable temp folders and patterns.
Post parameter name and value.
Post parameter name and associated file information.
Information on an uploaded file.
Constructors
Parse a content type value, turning a single ByteString into the actual
content type and a list of pairs of attributes.
A data structure that describes the behavior of the parseRequestBodyEx function.
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.
Do not impose any memory limits.
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
Set the maximum length of a filename.
Do not limit the length of filenames.
Set the maximum number of files per request.
Do not limit the maximum number of files per request.
Set the maximum filesize per file (in bytes).
Do not limit the maximum filesize per file.
Set the maximum size of all files per request.
Do not limit the maximum size of all files per request.
Set the maximum size of the sum of all parameters.
Do not limit the maximum size of the sum of all parameters.
Set the maximum header lines per mime/multipart entry.
Do not limit the maximum header lines per mime/multipart entry.
Set the maximum header line length per mime/multipart entry.
Do not limit the maximum header lines per mime/multipart entry.