Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Network.HTTP.Barf.Internal
Synopsis
- newtype Req = MkReq {}
- get_ :: MonadIO m => String -> Req -> m LazyByteString
- head_ :: MonadIO m => String -> Req -> m LazyByteString
- post_ :: MonadIO m => String -> Req -> m LazyByteString
- put_ :: MonadIO m => String -> Req -> m LazyByteString
- delete_ :: MonadIO m => String -> Req -> m LazyByteString
- q_ :: String -> String -> Req
- h_ :: String -> String -> Req
- j_ :: ToJSON a => a -> Req
- v_ :: Value -> Req
- inspectRequest_ :: Req
- dryRun_ :: Req
- httpWithManager :: MonadIO m => StrictByteString -> String -> Req -> m LazyByteString
- buildRequestFromReq :: StrictByteString -> String -> Req' -> IO Request
- data Req' = MkReq' {}
- defaultReq' :: Req'
exported
The type of request modifications.
The most important features of this type are the Monoid
, Semigroup
and IsList
instances.
Instances
Monoid Req Source # | the empty |
Semigroup Req Source # | combining to |
IsList Req Source # | An Even though |
type Item Req Source # | |
Defined in Network.HTTP.Barf.Internal |
Arguments
:: MonadIO m | |
=> String | the url to connect to |
-> Req | the modifier(s) to the request |
-> m LazyByteString |
creates a GET
request, use it like
get_
"http://localhost:8080" []
Arguments
:: MonadIO m | |
=> String | the url to connect to |
-> Req | the modifier(s) to the request |
-> m LazyByteString |
creates a HEAD
request, use it like
head_
"http://localhost:8080" []
Arguments
:: MonadIO m | |
=> String | the url to connect to |
-> Req | the modifier(s) to the request |
-> m LazyByteString |
creates a POST
request, use it like
post_
"http://localhost:8080" []
Arguments
:: MonadIO m | |
=> String | the url to connect to |
-> Req | the modifier(s) to the request |
-> m LazyByteString |
creates a PUT
request, use it like
put_
"http://localhost:8080" []
Arguments
:: MonadIO m | |
=> String | the url to connect to |
-> Req | the modifier(s) to the request |
-> m LazyByteString |
creates a DELETE
request, use it like
delete_
"http://localhost:8080" []
q_
like "query"
h_
like "header"
j_
like "json"
if the json body is already set, it will be overwritten
inspectRequest_ :: Req Source #
print the request before dispatching, useful for debugging
internal
httpWithManager :: MonadIO m => StrictByteString -> String -> Req -> m LazyByteString Source #
buildRequestFromReq :: StrictByteString -> String -> Req' -> IO Request Source #
a data type representing an http request
Constructors
MkReq' | |
Instances
Generic Req' Source # | |
Show Req' Source # | |
Eq Req' Source # | |
Ord Req' Source # | |
type Rep Req' Source # | |
Defined in Network.HTTP.Barf.Internal type Rep Req' = D1 ('MetaData "Req'" "Network.HTTP.Barf.Internal" "http-barf-0.1.1.0-inplace" 'False) (C1 ('MetaCons "MkReq'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "queryParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Vector (String, String))) :*: S1 ('MetaSel ('Just "headers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Vector (String, String)))) :*: (S1 ('MetaSel ('Just "jsonBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Value)) :*: (S1 ('MetaSel ('Just "inspectRequest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))))) |
defaultReq' :: Req' Source #