wai-extra-2.1.1.2: Provides some basic WAI handlers and middleware.

Safe HaskellNone

Network.Wai.Parse

Description

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

Synopsis

Documentation

parseHttpAccept :: ByteString -> [ByteString]Source

Parse the HTTP accept string to determine supported content types.

type BackEnd aSource

Arguments

 = ByteString

parameter name

-> FileInfo () 
-> Sink ByteString IO a 

A file uploading backend. Takes the parameter name, file name, and content type, and returns a Sink for storing the contents.

lbsBackEnd :: Monad m => ignored1 -> ignored2 -> Sink ByteString m ByteStringSource

Store uploaded files in memory

tempFileBackEnd :: InternalState -> ignored1 -> ignored2 -> Sink ByteString IO FilePathSource

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.

tempFileBackEndOptsSource

Arguments

:: IO FilePath

get temporary directory

-> String

filename pattern

-> InternalState 
-> ignored1 
-> ignored2 
-> Sink ByteString IO FilePath 

Same as tempFileSink, but use configurable temp folders and patterns.

type Param = (ByteString, ByteString)Source

Post parameter name and value.

type File y = (ByteString, FileInfo y)Source

Post parameter name and associated file information.

data FileInfo c Source

Information on an uploaded file.

Instances

Eq c => Eq (FileInfo c) 
Show c => Show (FileInfo c) 

parseContentType :: ByteString -> (ByteString, [(ByteString, ByteString)])Source

Parse a content type value, turning a single ByteString into the actual content type and a list of pairs of attributes.

Since 1.3.2