polysemy-http-0.3.0.0: Polysemy effect for http-client
Safe HaskellNone
LanguageHaskell2010

Polysemy.Http.Data.Request

Synopsis

Documentation

data Method Source #

All standard HTTP methods, mirroring those from Types, plus a constructor for arbitrary strings.

Instances

Instances details
Eq Method Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Method -> Method -> Bool #

(/=) :: Method -> Method -> Bool #

Show Method Source # 
Instance details

Defined in Polysemy.Http.Data.Request

IsString Method Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

fromString :: String -> Method #

FromJSON Method Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser Method

parseJSONList :: Value -> Parser [Method]

ToJSON Method Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: Method -> Value

toEncoding :: Method -> Encoding

toJSONList :: [Method] -> Value

toEncodingList :: [Method] -> Encoding

methodUpper :: Method -> Text Source #

Produce the usual uppercase representation of a method.

newtype Host Source #

Request host name.

Constructors

Host 

Fields

Instances

Instances details
Eq Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Host -> Host -> Bool #

(/=) :: Host -> Host -> Bool #

Show Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

showsPrec :: Int -> Host -> ShowS #

show :: Host -> String #

showList :: [Host] -> ShowS #

IsString Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

fromString :: String -> Host #

Generic Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep Host :: Type -> Type #

Methods

from :: Host -> Rep Host x #

to :: Rep Host x -> Host #

FromJSON Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser Host

parseJSONList :: Value -> Parser [Host]

ToJSON Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: Host -> Value

toEncoding :: Host -> Encoding

toJSONList :: [Host] -> Value

toEncodingList :: [Host] -> Encoding

type Rep Host Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep Host = D1 ('MetaData "Host" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Host" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype Port Source #

Request port.

Constructors

Port 

Fields

Instances

Instances details
Eq Port Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Port -> Port -> Bool #

(/=) :: Port -> Port -> Bool #

Show Port Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

showsPrec :: Int -> Port -> ShowS #

show :: Port -> String #

showList :: [Port] -> ShowS #

Generic Port Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep Port :: Type -> Type #

Methods

from :: Port -> Rep Port x #

to :: Rep Port x -> Port #

FromJSON Port Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser Port

parseJSONList :: Value -> Parser [Port]

ToJSON Port Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: Port -> Value

toEncoding :: Port -> Encoding

toJSONList :: [Port] -> Value

toEncodingList :: [Port] -> Encoding

type Rep Port Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep Port = D1 ('MetaData "Port" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Port" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

newtype Tls Source #

A flag that indicates whether a request should use TLS.

Constructors

Tls 

Fields

Instances

Instances details
Eq Tls Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Tls -> Tls -> Bool #

(/=) :: Tls -> Tls -> Bool #

Show Tls Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

showsPrec :: Int -> Tls -> ShowS #

show :: Tls -> String #

showList :: [Tls] -> ShowS #

Generic Tls Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep Tls :: Type -> Type #

Methods

from :: Tls -> Rep Tls x #

to :: Rep Tls x -> Tls #

FromJSON Tls Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser Tls

parseJSONList :: Value -> Parser [Tls]

ToJSON Tls Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: Tls -> Value

toEncoding :: Tls -> Encoding

toJSONList :: [Tls] -> Value

toEncodingList :: [Tls] -> Encoding

type Rep Tls Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep Tls = D1 ('MetaData "Tls" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Tls" 'PrefixI 'True) (S1 ('MetaSel ('Just "unTls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

newtype Path Source #

Rrequest path.

Constructors

Path 

Fields

Instances

Instances details
Eq Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Show Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

IsString Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

fromString :: String -> Path #

Generic Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep Path :: Type -> Type #

Methods

from :: Path -> Rep Path x #

to :: Rep Path x -> Path #

Semigroup Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(<>) :: Path -> Path -> Path #

sconcat :: NonEmpty Path -> Path #

stimes :: Integral b => b -> Path -> Path #

Monoid Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

mempty :: Path #

mappend :: Path -> Path -> Path #

mconcat :: [Path] -> Path #

FromJSON Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser Path

parseJSONList :: Value -> Parser [Path]

ToJSON Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: Path -> Value

toEncoding :: Path -> Encoding

toJSONList :: [Path] -> Value

toEncodingList :: [Path] -> Encoding

type Rep Path Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep Path = D1 ('MetaData "Path" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Path" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype QueryKey Source #

The key of a query parameter.

Constructors

QueryKey 

Fields

Instances

Instances details
Eq QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Show QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

IsString QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Generic QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep QueryKey :: Type -> Type #

Methods

from :: QueryKey -> Rep QueryKey x #

to :: Rep QueryKey x -> QueryKey #

FromJSON QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser QueryKey

parseJSONList :: Value -> Parser [QueryKey]

ToJSON QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: QueryKey -> Value

toEncoding :: QueryKey -> Encoding

toJSONList :: [QueryKey] -> Value

toEncodingList :: [QueryKey] -> Encoding

type Rep QueryKey Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep QueryKey = D1 ('MetaData "QueryKey" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "QueryKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unQueryKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype QueryValue Source #

The value of a query parameter.

Constructors

QueryValue 

Fields

Instances

Instances details
Eq QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Show QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

IsString QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Generic QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep QueryValue :: Type -> Type #

FromJSON QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

parseJSON :: Value -> Parser QueryValue

parseJSONList :: Value -> Parser [QueryValue]

ToJSON QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

toJSON :: QueryValue -> Value

toEncoding :: QueryValue -> Encoding

toJSONList :: [QueryValue] -> Value

toEncodingList :: [QueryValue] -> Encoding

type Rep QueryValue Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep QueryValue = D1 ('MetaData "QueryValue" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "QueryValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "unQueryValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype Body Source #

Request body, using LByteString because it is what encode produces.

Constructors

Body 

Fields

Instances

Instances details
Eq Body Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

IsString Body Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

fromString :: String -> Body #

Generic Body Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep Body :: Type -> Type #

Methods

from :: Body -> Rep Body x #

to :: Rep Body x -> Body #

type Rep Body Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep Body = D1 ('MetaData "Body" "Polysemy.Http.Data.Request" "polysemy-http-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Body" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LByteString)))

data Request Source #

HTTP request parameters, used by Http.

Constructors

Request 

Instances

Instances details
Eq Request Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Methods

(==) :: Request -> Request -> Bool #

(/=) :: Request -> Request -> Bool #

Show Request Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Generic Request Source # 
Instance details

Defined in Polysemy.Http.Data.Request

Associated Types

type Rep Request :: Type -> Type #

Methods

from :: Request -> Rep Request x #

to :: Rep Request x -> Request #

HasRequest Request Source # 
Instance details

Defined in Polysemy.Http.Data.Request

type Rep Request Source # 
Instance details

Defined in Polysemy.Http.Data.Request

class HasRequest c where Source #

Minimal complete definition

request

Methods

request :: Lens' c Request Source #

body :: Lens' c Body Source #

cookies :: Lens' c CookieJar Source #

headers :: Lens' c [(HeaderName, HeaderValue)] Source #

host :: Lens' c Host Source #

method :: Lens' c Method Source #

path :: Lens' c Path Source #

port :: Lens' c (Maybe Port) Source #

query :: Lens' c [(QueryKey, Maybe QueryValue)] Source #

tls :: Lens' c Tls Source #

Instances

Instances details
HasRequest Request Source # 
Instance details

Defined in Polysemy.Http.Data.Request