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

Network.Wai.Parse

Description

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

Synopsis

Documentation

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

Split out the query string into a list of keys and values. A few importants points:

  • There is no way to distinguish between a parameter with no value and a parameter with an empty value. Eg, foo= and foo are the same.
  • The result returned is still bytestrings, since we perform no character decoding here. Most likely, you will want to use UTF-8 decoding, but this is left to the user of the library.
  • Percent decoding errors are ignored. In particular, %Q will be output as %Q.

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

Decode the value of an HTTP_COOKIE header into key/value pairs.

parseHttpAccept :: ByteString -> [ByteString]Source

Parse the HTTP accept string to determine supported content types.

parseRequestBody :: Sink x y -> Request -> IO ([Param], [File y])Source

data Sink x y Source

A destination for data, the opposite of a Source.

Constructors

Sink 

Fields

sinkInit :: IO x
 
sinkAppend :: x -> ByteString -> IO x
 
sinkClose :: x -> IO y
 
sinkFinalize :: y -> IO ()
 

data FileInfo c Source

Information on an uploaded file.

Instances

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