miso-0.16.0.0: A tasty Haskell front-end framework

Copyright(C) 2016-2018 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <djohnson.m@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Effect.XHR

Description

 

Synopsis

Documentation

data RouteInfo Source

Still a WIP, use ghcjs-base XHR for now, or other

Intermediate type for accumulation

Constructors

RouteInfo 

Fields

riPath :: String
 
riMethod :: Method
 

class HasXHR api where Source

Class for XHR

Associated Types

type XHR api :: * Source

Methods

xhrWithRoute :: Proxy api -> RouteInfo -> XHR api Source

Instances

(HasXHR left, HasXHR right) => HasXHR ((:<|>) left right) Source

Raw (not supported) instance HasXHR Raw where type XHR Raw = XHR (Response MisoString) xhrWithRoute Proxy _ = putStrLn "Raw is not supported"

Alternate

HasXHR api => HasXHR ((:>) (Symbol -> [*] -> * -> *) * WithNamedContext api) Source

WithNamedContext (done)

HasXHR api => HasXHR ((:>) * * HttpVersion api) Source

HttpVersion

(ToHttpApiData a, HasXHR api, KnownSymbol sym) => HasXHR ((:>) * * (Capture * sym a) api) Source

Capture

(KnownSymbol capture, ToHttpApiData a, HasXHR sublayout) => HasXHR ((:>) * * (CaptureAll * capture a) sublayout) Source

CaptureAll

(ToHttpApiData a, HasXHR api, KnownSymbol sym) => HasXHR ((:>) * * (Header sym a) api) Source

Header

(KnownSymbol sym, ToHttpApiData a, HasXHR api) => HasXHR ((:>) * * (QueryParam * sym a) api) Source

Query param

(KnownSymbol sym, ToHttpApiData a, HasXHR api) => HasXHR ((:>) * * (QueryParams * sym a) api) Source

Query param(s)

(KnownSymbol sym, HasXHR api) => HasXHR ((:>) * * (QueryFlag sym) api) Source

Query flag

(MimeRender * ct a, HasXHR api) => HasXHR ((:>) * * (ReqBody * ((:) * ct cts) a) api) Source

Request Body

HasXHR api => HasXHR ((:>) * * RemoteHost api) Source

Remote host (done)

HasXHR api => HasXHR ((:>) * * IsSecure api) Source

IsSecure host (done)

HasXHR api => HasXHR ((:>) * * (BasicAuth realm usr) api) Source

BasicAuth

HasXHR api => HasXHR ((:>) * * Vault api) Source

Vault (done)

(HasXHR api, KnownSymbol sym) => HasXHR ((:>) Symbol * sym api) Source

Path (done)

(BuildHeadersTo ls, ReflectMethod * method) => HasXHR (Verb * * method status cts (Headers ls NoContent)) Source

Headers, with NoContent

(MimeUnrender * ct a, BuildHeadersTo ls, ReflectMethod * method, (~) [*] cts' ((:) * ct cts)) => HasXHR (Verb * * method status cts' (Headers ls a)) Source

Verb, with HEADERS

ReflectMethod * method => HasXHR (Verb * * method status cts NoContent) Source

Verb NoContent

(MimeUnrender * ct a, ReflectMethod * method, (~) [*] cts' ((:) * ct cts)) => HasXHR (Verb * * method status cts' a) Source

Verb

type Result a = IO (Either MisoString a) Source

Result of using XHR