Options for configuring a client.
Constructors
Optionsmanager :: MgrEither configuration for a Manager, or an actual Manager.
If only ManagerSettings are provided, then by default a new Manager will be created for each request.
Note: when issuing HTTP requests using Options-based functions from the the Network.Wreq.Session module (getWith, putWith, etc.), this field will be ignored.
An example of using a specific manager:
import Network.HTTP.Client (withManager) withManager $ \mgr -> do let opts = defaults { manager = Right mgr } getWith opts "http://httpbin.org/get"An example of changing settings (this will use a separate Manager for every request, so make sense only if you're issuing a tiny handful of requets):
import Network.HTTP.Client (defaultManagerSettings) let settings = defaultManagerSettings { managerConnCount = 5 } opts = defaults { manager = Left settings } getWith opts "http://httpbin.org/get"proxy :: Maybe ProxyHost name and port for a proxy to use, if any.
auth :: Maybe Authheaders :: [Header]params :: [(Text, Text)]redirects :: IntThe maximum number of HTTP redirects to follow before giving up and throwing an exception.
In this example, a HttpException will be thrown with a TooManyRedirects constructor, because the maximum number of redirects allowed will be exceeded:
let opts = defaults { redirects = 3 } getWith opts "http://httpbin.org/redirect/5"checkResponse :: Maybe ResponseChecker