Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- statusCode :: Response a -> Int
- statusMessage :: Response a -> ByteString
- getHeader :: HeaderName -> Response a -> Maybe ByteString
- getHeader' :: HeaderName -> Response a -> ByteString
- getCookie :: ByteString -> Response a -> Maybe Cookie
- getCookieValue :: ByteString -> Response a -> Maybe ByteString
- showResponse :: Show a => Response a -> String
- data Response body
- type ResponseLBS = Response (Maybe LByteString)
- responseStatus :: Response body -> Status
- responseHeaders :: Response body -> ResponseHeaders
- responseVersion :: Response body -> HttpVersion
- responseBody :: Response body -> body
- responseJsonEither :: forall a. (HasCallStack, Typeable a, FromJSON a) => ResponseLBS -> Either String a
- responseJsonMaybe :: (HasCallStack, Typeable a, FromJSON a) => ResponseLBS -> Maybe a
- responseJsonThrow :: (HasCallStack, MonadThrow m, Typeable a, FromJSON a, Exception e) => (String -> e) -> ResponseLBS -> m a
- responseJsonError :: (HasCallStack, MonadThrow m, Typeable a, FromJSON a) => ResponseLBS -> m a
- responseJsonUnsafe :: (HasCallStack, Typeable a, FromJSON a) => ResponseLBS -> a
- responseJsonUnsafeWithMsg :: (HasCallStack, Typeable a, FromJSON a) => String -> ResponseLBS -> a
Helpers
statusCode :: Response a -> Int Source #
statusMessage :: Response a -> ByteString Source #
getHeader :: HeaderName -> Response a -> Maybe ByteString Source #
getHeader' :: HeaderName -> Response a -> ByteString Source #
Like getHeader
, but if no value exists for the given key, return the
static ByteString "NO_HEADER_VALUE".
getCookieValue :: ByteString -> Response a -> Maybe ByteString Source #
Retrieve the value of a given cookie name from a "Set-Cookie" header on the response
Re-exports
A simple representation of the HTTP response.
Since 0.1.0
Instances
Foldable Response | |
Defined in Network.HTTP.Client.Types fold :: Monoid m => Response m -> m # foldMap :: Monoid m => (a -> m) -> Response a -> m # foldMap' :: Monoid m => (a -> m) -> Response a -> m # foldr :: (a -> b -> b) -> b -> Response a -> b # foldr' :: (a -> b -> b) -> b -> Response a -> b # foldl :: (b -> a -> b) -> b -> Response a -> b # foldl' :: (b -> a -> b) -> b -> Response a -> b # foldr1 :: (a -> a -> a) -> Response a -> a # foldl1 :: (a -> a -> a) -> Response a -> a # elem :: Eq a => a -> Response a -> Bool # maximum :: Ord a => Response a -> a # minimum :: Ord a => Response a -> a # | |
Traversable Response | |
Functor Response | |
Show body => Show (Response body) | |
type ResponseLBS = Response (Maybe LByteString) Source #
responseStatus :: Response body -> Status Source #
Status code of the response.
Since 0.1.0
responseHeaders :: Response body -> ResponseHeaders Source #
Response headers sent by the server.
Since 0.1.0
responseVersion :: Response body -> HttpVersion Source #
HTTP version used by the server.
Since 0.1.0
responseBody :: Response body -> body Source #
Response body sent by the server.
Since 0.1.0
responseJsonEither :: forall a. (HasCallStack, Typeable a, FromJSON a) => ResponseLBS -> Either String a Source #
responseJsonMaybe :: (HasCallStack, Typeable a, FromJSON a) => ResponseLBS -> Maybe a Source #
responseJsonThrow :: (HasCallStack, MonadThrow m, Typeable a, FromJSON a, Exception e) => (String -> e) -> ResponseLBS -> m a Source #
responseJsonError :: (HasCallStack, MonadThrow m, Typeable a, FromJSON a) => ResponseLBS -> m a Source #
responseJsonUnsafe :: (HasCallStack, Typeable a, FromJSON a) => ResponseLBS -> a Source #
responseJsonUnsafeWithMsg :: (HasCallStack, Typeable a, FromJSON a) => String -> ResponseLBS -> a Source #