Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Make HTTPS connections using http-client and Rustls.
>>>
import qualified Network.HTTP.Client as HTTP
>>>
import qualified Network.HTTP.Client.Rustls as HTTP
>>>
:{
example :: IO () example = do mgr <- HTTP.newRustlsManager -- this should be shared across multiple requests req <- HTTP.parseUrlThrow "https://example.org" res <- HTTP.httpLbs req mgr print $ HTTP.responseBody res :}
Synopsis
- newRustlsManager :: MonadIO m => m Manager
- rustlsManagerSettings :: ClientConfig -> ManagerSettings
Documentation
newRustlsManager :: MonadIO m => m Manager Source #
Create a new Manager
using good TLS defaults and the OS certificate
store.
rustlsManagerSettings :: ClientConfig -> ManagerSettings Source #
Get TLS-enabled HTTP ManagerSettings
from a Rustls
ClientConfig
, consumable via newManager
.