Safe Haskell | None |
---|---|
Language | GHC2021 |
Polysemy.Http.Effect.Http
Description
Synopsis
- data Http c (a :: Type -> Type) b where
- Response :: forall c (a :: Type -> Type) a1. Request -> (Response c -> a a1) -> Http c a (Either HttpError a1)
- Request :: forall c (a :: Type -> Type). Request -> Http c a (Either HttpError (Response LByteString))
- ConsumeChunk :: forall c (a :: Type -> Type). Maybe Int -> c -> Http c a (Either HttpError ByteString)
- response :: forall c (r :: EffectRow) a. Member (Http c) r => Request -> (Response c -> Sem r a) -> Sem r (Either HttpError a)
- request :: forall c (r :: EffectRow). Member (Http c) r => Request -> Sem r (Either HttpError (Response LByteString))
- consumeChunk :: forall c (r :: EffectRow). Member (Http c) r => Maybe Int -> c -> Sem r (Either HttpError ByteString)
Documentation
data Http c (a :: Type -> Type) b where Source #
The main effect for HTTP requests.
The parameter c
determines the representation of raw chunks.
Constructors
Response :: forall c (a :: Type -> Type) a1. Request -> (Response c -> a a1) -> Http c a (Either HttpError a1) | |
Request :: forall c (a :: Type -> Type). Request -> Http c a (Either HttpError (Response LByteString)) | |
ConsumeChunk :: forall c (a :: Type -> Type). Maybe Int -> c -> Http c a (Either HttpError ByteString) | Internal action for streaming transfers. |
response :: forall c (r :: EffectRow) a. Member (Http c) r => Request -> (Response c -> Sem r a) -> Sem r (Either HttpError a) Source #
Bracket a higher-order action with a Response
that has been opened while its body
hasn't been fetched.