digestive-functors-snap-0.6.1.2: Snap backend for the digestive-functors library

Safe HaskellNone
LanguageHaskell98

Text.Digestive.Snap

Description

Module providing a Snap backend for the digestive-functors library

Synopsis

Documentation

data SnapFormConfig Source

Constructors

SnapFormConfig 

Fields

method :: Maybe Method

Can be used to override the method detected by Snap, in case you e.g. want to perform a postForm even in case of a GET request.

temporaryDirectory :: Maybe FilePath
 
uploadPolicy :: UploadPolicy
 
partPolicy :: SnapPartPolicy
 

runForm Source

Arguments

:: MonadSnap m 
=> Text

Name for the form

-> Form v m a

Form to run

-> m (View v, Maybe a)

Result

Runs a form with the HTTP input provided by Snap.

Automatically picks between getForm and postForm based on the request method. Set method in the SnapFormConfig to override this behaviour.

runFormWith Source

Arguments

:: MonadSnap m 
=> SnapFormConfig

Tempdir and upload policies

-> Text

Name for the form

-> Form v m a

Form to run

-> m (View v, Maybe a)

Result

Runs a form with a custom upload policy, and HTTP input from snap.

Automatically picks between getForm and postForm based on request method. Set method in the SnapFormConfig to override this behaviour.