Safe Haskell | None |
---|---|
Language | Haskell2010 |
Use this module instead of Network.Wreq.Session
to use string-like datatypes.
see https://hackage.haskell.org/package/wreq/docs/Network-Wreq-Session.html
- data Session :: *
- newSession :: IO Session
- newAPISession :: IO Session
- withSession :: (Session -> IO a) -> IO a
- withAPISession :: (Session -> IO a) -> IO a
- newSessionControl :: Maybe CookieJar -> ManagerSettings -> IO Session
- withSessionWith :: ManagerSettings -> (Session -> IO a) -> IO a
- withSessionControl :: Maybe CookieJar -> ManagerSettings -> (Session -> IO a) -> IO a
- getSessionCookieJar :: Session -> IO (Maybe CookieJar)
- get :: StringLike s => Session -> s -> IO (Response ByteString)
- getWith :: StringLike s => Options -> Session -> s -> IO (Response ByteString)
- post :: StringLike s => Postable a => Session -> s -> a -> IO (Response ByteString)
- postWith :: StringLike s => Postable a => Options -> Session -> s -> a -> IO (Response ByteString)
- head_ :: StringLike s => Session -> s -> IO (Response ())
- headWith :: StringLike s => Options -> Session -> s -> IO (Response ())
- options :: StringLike s => Session -> s -> IO (Response ())
- optionsWith :: StringLike s => Options -> Session -> s -> IO (Response ())
- put :: StringLike s => Putable a => Session -> s -> a -> IO (Response ByteString)
- putWith :: StringLike s => Putable a => Options -> Session -> s -> a -> IO (Response ByteString)
- delete :: StringLike s => Session -> s -> IO (Response ByteString)
- deleteWith :: StringLike s => Options -> Session -> s -> IO (Response ByteString)
- customMethod :: StringLike s => s -> Session -> s -> IO (Response ByteString)
- customMethodWith :: StringLike s => s -> Options -> Session -> s -> IO (Response ByteString)
- customPayloadMethodWith :: (Postable a, StringLike s) => s -> Options -> Session -> s -> a -> IO (Response ByteString)
- customHistoriedMethodWith :: StringLike s => s -> Options -> Session -> s -> IO (HistoriedResponse ByteString)
- customHistoriedPayloadMethodWith :: (Postable a, StringLike s) => s -> Options -> Session -> s -> a -> IO (HistoriedResponse ByteString)
- seshRun :: Lens' Session (Session -> Run Body -> Run Body)
Session creation
A session that spans multiple requests. This is responsible for cookie management and TCP connection reuse.
newSession :: IO Session #
Create a Session
.
This session manages cookies and uses default session manager configuration.
Since: 0.5.2.0
newAPISession :: IO Session #
Create a session.
This uses the default session manager settings, but does not manage cookies. It is intended for use with REST-like HTTP-based APIs, which typically do not use cookies.
Since: 0.5.2.0
withSession :: (Session -> IO a) -> IO a #
withAPISession :: (Session -> IO a) -> IO a #
Create a session.
This uses the default session manager settings, but does not manage cookies. It is intended for use with REST-like HTTP-based APIs, which typically do not use cookies.
More control-oriented session creation
:: Maybe CookieJar | If |
-> ManagerSettings | |
-> IO Session |
Create a session, using the given cookie jar and manager settings.
Since: 0.5.2.0
withSessionWith :: ManagerSettings -> (Session -> IO a) -> IO a #
Create a session, using the given manager settings. This session manages cookies.
:: Maybe CookieJar | If |
-> ManagerSettings | |
-> (Session -> IO a) | |
-> IO a |
Create a session, using the given cookie jar and manager settings.
Get information about session state
HTTP verbs
GET
get :: StringLike s => Session -> s -> IO (Response ByteString) Source #
getWith :: StringLike s => Options -> Session -> s -> IO (Response ByteString) Source #
POST
post :: StringLike s => Postable a => Session -> s -> a -> IO (Response ByteString) Source #
postWith :: StringLike s => Postable a => Options -> Session -> s -> a -> IO (Response ByteString) Source #
HEAD
OPTIONS
optionsWith :: StringLike s => Options -> Session -> s -> IO (Response ()) Source #
PUT
put :: StringLike s => Putable a => Session -> s -> a -> IO (Response ByteString) Source #
putWith :: StringLike s => Putable a => Options -> Session -> s -> a -> IO (Response ByteString) Source #
DELTE
delete :: StringLike s => Session -> s -> IO (Response ByteString) Source #
deleteWith :: StringLike s => Options -> Session -> s -> IO (Response ByteString) Source #
Custom Method
customMethod :: StringLike s => s -> Session -> s -> IO (Response ByteString) Source #
customMethodWith :: StringLike s => s -> Options -> Session -> s -> IO (Response ByteString) Source #
Custom Payload Method
customPayloadMethodWith :: (Postable a, StringLike s) => s -> Options -> Session -> s -> a -> IO (Response ByteString) Source #
customHistoriedMethodWith :: StringLike s => s -> Options -> Session -> s -> IO (HistoriedResponse ByteString) Source #
customHistoriedPayloadMethodWith :: (Postable a, StringLike s) => s -> Options -> Session -> s -> a -> IO (HistoriedResponse ByteString) Source #