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

Safe HaskellSafe-Infered

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 (ResourceT 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 :: MonadResource m => ignored1 -> ignored2 -> Sink ByteString m FilePathSource

Save uploaded files on disk as temporary files

tempFileBackEndOptsSource

Arguments

:: MonadResource m 
=> IO FilePath

get temporary directory

-> String

filename pattern

-> ignored1 
-> ignored2 
-> Sink ByteString m FilePath 

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

data FileInfo c Source

Information on an uploaded file.

Instances

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