Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.HTTP.Client.Overrides
Contents
Synopsis
- withHttpClientOverrides :: HasCallStack => ManagerSettings -> IO (Either ParseException ManagerSettings)
- withHttpClientOverridesThrow :: HasCallStack => ManagerSettings -> IO ManagerSettings
- withHttpClientOverridesFile :: ConfigFile -> ManagerSettings -> ManagerSettings
- httpClientOverrides :: Config -> ManagerSettings -> ManagerSettings
- parseConfigFile :: FilePath -> IO (Either ParseException ConfigFile)
- data ConfigFile = V1 Config
- data Config = Config {}
- data LogOptions = LogOptions {
- logResponses :: !(Maybe LogFormat)
- logRequests :: !(Maybe LogFormat)
- logRequestOverrides :: !(Maybe LogFormat)
- data LogFormat
- data RequestOverride = RequestOverride {}
- data URL = URL {}
HTTP client overrides
withHttpClientOverrides :: HasCallStack => ManagerSettings -> IO (Either ParseException ManagerSettings) Source #
If the HTTP_CLIENT_OVERRIDES
environment variable is set, this function
reads the specified file as a ConfigFile
and applies the overrides to
ManagerSettings
.
withHttpClientOverridesThrow :: HasCallStack => ManagerSettings -> IO ManagerSettings Source #
If the HTTP_CLIENT_OVERRIDES
environment variable is set, this function
reads the specified file as a ConfigFile
and applies the overrides to
ManagerSettings
. Throws an exception if the config file can't be parsed.
withHttpClientOverridesFile :: ConfigFile -> ManagerSettings -> ManagerSettings Source #
Applies the overrides from a ConfigFile
to ManagerSettings
.
httpClientOverrides :: Config -> ManagerSettings -> ManagerSettings Source #
Overrides ManagerSettings
using an HTTP client override Config
. Use
this function if you want to define overrides directly in your source code
rather than from a config file.
parseConfigFile :: FilePath -> IO (Either ParseException ConfigFile) Source #
Parses a file as a ConfigFile
. Use this function if you need control
over how the config file is loaded.
Types
data ConfigFile Source #
The configuration file is versioned so that it can be changed in the
future and the old format gradually deprecated. The parsers uses the
version
field to decide how to parse the file.
Instances
Eq ConfigFile Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types | |
Show ConfigFile Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types Methods showsPrec :: Int -> ConfigFile -> ShowS # show :: ConfigFile -> String # showList :: [ConfigFile] -> ShowS # | |
Generic ConfigFile Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types Associated Types type Rep ConfigFile :: Type -> Type # | |
FromJSON ConfigFile Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types | |
type Rep ConfigFile Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types type Rep ConfigFile = D1 (MetaData "ConfigFile" "Network.HTTP.Client.Overrides.Internal.Types" "http-client-overrides-0.1.0.0-4duS79XYkcoEoPmgH4WZW5" False) (C1 (MetaCons "V1" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Config))) |
This type is used when the ConfigFile
version is v1
.
Constructors
Config | |
Fields
|
Instances
Eq Config Source # | |
Show Config Source # | |
Generic Config Source # | |
FromJSON Config Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types | |
type Rep Config Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types type Rep Config = D1 (MetaData "Config" "Network.HTTP.Client.Overrides.Internal.Types" "http-client-overrides-0.1.0.0-4duS79XYkcoEoPmgH4WZW5" False) (C1 (MetaCons "Config" PrefixI True) (S1 (MetaSel (Just "logOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 LogOptions) :*: S1 (MetaSel (Just "requestOverrides") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [RequestOverride]))) |
data LogOptions Source #
Constructors
LogOptions | |
Fields
|
Instances
data RequestOverride Source #
Constructors
RequestOverride | |
Instances
Constructors
URL | |
Instances
Eq URL Source # | |
Show URL Source # | |
Generic URL Source # | |
FromJSON URL Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types | |
type Rep URL Source # | |
Defined in Network.HTTP.Client.Overrides.Internal.Types type Rep URL = D1 (MetaData "URL" "Network.HTTP.Client.Overrides.Internal.Types" "http-client-overrides-0.1.0.0-4duS79XYkcoEoPmgH4WZW5" False) (C1 (MetaCons "URL" PrefixI True) ((S1 (MetaSel (Just "secure") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "host") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ByteString))) :*: (S1 (MetaSel (Just "port") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int)) :*: S1 (MetaSel (Just "path") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ByteString))))) |