Safe Haskell | None |
---|
- initTransport :: EndpointURL -> RequestP -> BodyP -> IO Transport
- initTransport_ :: EndpointURL -> IO Transport
- initTransportWith :: ManagerSettings -> EndpointURL -> RequestP -> BodyP -> IO Transport
- confTransport :: Text -> Config -> IO Transport
- confTransportWith :: ManagerSettings -> Text -> Config -> RequestP -> BodyP -> IO Transport
- type EndpointURL = String
- type RequestP = Request -> Request
- traceRequest :: RequestP
- type BodyP = ByteString -> ByteString
- iconv :: EncodingName -> BodyP
- traceBody :: BodyP
- runQuery :: Manager -> EndpointURL -> RequestP -> BodyP -> Transport
Initialization
initTransport :: EndpointURL -> RequestP -> BodyP -> IO TransportSource
Create a http-client transport. Use identity transformers if you don't need any special treatment.
initTransport_ :: EndpointURL -> IO TransportSource
Create a transport without any request and body processing.
initTransportWith :: ManagerSettings -> EndpointURL -> RequestP -> BodyP -> IO TransportSource
Create a http-client transport using manager settings (for plugging tls etc.).
confTransport :: Text -> Config -> IO TransportSource
Load common transport parameters from a configurator file.
soap { url = "https://vendor.tld/service/" trace = true timeout = 15 }
Only url field is required.
import Data.Configurator (load, Worth(Required)) main = do transport <- confTransport "soap" =<< load [Required "etc/example.conf"]
confTransportWith :: ManagerSettings -> Text -> Config -> RequestP -> BodyP -> IO TransportSource
A more extensible transport parameter loader.
type EndpointURL = StringSource
Web service URL. Configured at initialization, but you can tweak it dynamically with a request processor.
Making a request
type RequestP = Request -> RequestSource
Update request record after defaults and method-specific fields are set.
traceRequest :: RequestPSource
Show a debug dump of a request body.
Processing a response
type BodyP = ByteString -> ByteStringSource
Process response body to make it a nice UTF8-encoded XML document.
iconv :: EncodingName -> BodyPSource
Create an IConv-based processor.