salvia-1.0.0: Modular web application framework.

Network.Salvia.Handler.Put

Synopsis

Documentation

hPutFileSystem :: (MonadIO m, HttpM' m, SendM m, BodyM Request m) => FilePath -> m ()Source

Create a browseable filesystem handler (like hFileSystem) but make all files writeable by a PUT request. Files that do not exists will be created as long as the directory in which they will be created exists.

hPutResource :: (MonadIO m, BodyM Request m, HttpM' m, SendM m) => (FilePath -> m ()) -> FilePath -> m ()Source

Invokes the hStore handler when the request is a PUT request and invokes the fallback handler otherwiser.

hStore :: (MonadIO m, BodyM Request m, HttpM Response m, SendM m) => FilePath -> m ()Source

This handler takes a FilePath and will try to store the entire request body in that file. When the request body could for some reason not be fetch a BadRequest error response will be created. When an IO error occurs the hIOError function is used to setup an apropriate response.