Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Http c :: Effect where
- request :: forall c r. Member (Http c) r => Request -> Sem r (Either HttpError (Response LByteString))
- stream :: forall c r a. Member (Http c) r => Request -> (Response c -> Sem r (Either HttpError a)) -> Sem r (Either HttpError a)
- consumeChunk :: forall c r. Member (Http c) r => c -> Sem r (Either HttpError ByteString)
Documentation
data Http c :: Effect where Source #
The main effect for HTTP requests.
The parameter c
determines the representation of raw chunks.
Request :: Request -> Http c m (Either HttpError (Response LByteString)) | |
Stream :: Request -> (Response c -> m (Either HttpError a)) -> Http c m (Either HttpError a) | |
ConsumeChunk :: c -> Http c m (Either HttpError ByteString) | Internal effect for streaming transfers. |
Instances
type DefiningModule Http Source # | |
Defined in Polysemy.Http.Data.Http |
request :: forall c r. Member (Http c) r => Request -> Sem r (Either HttpError (Response LByteString)) Source #
Synchronously run an HTTP request and return the response.
stream :: forall c r a. Member (Http c) r => Request -> (Response c -> Sem r (Either HttpError a)) -> Sem r (Either HttpError a) Source #
Open a connection without consuming data and pass the response to a handler for custom transmission. The intended purpose is to allow streaming transfers.
consumeChunk :: forall c r. Member (Http c) r => c -> Sem r (Either HttpError ByteString) Source #