Authenticated/cached HTTP GET¶
Provide a base HTTP client with lazy construction, credential resolution, and optional response caching for Guidewire API calls.
| Field | Value |
|---|---|
| Operation ID | OP-SD-02 |
| Trigger | A derived client class issues a GET or cached GET/POST call. |
| Inputs | Request URL, optional request body, UseCache/ensureSuccess flags |
| Outputs | Deserialized response of type T, or a cached copy |
| Primary components | HttpClientBase |
| Entry point | Data/SAIF.Data/Clients/HttpClientBase.cs |
Steps¶
- Lazily create the
HttpClient. The base URL comes fromIEnvironmentService.GetConfigSetting(UrlKey)(SD-BR-003). - If
AuthKeyis set, compute the system hash:SystemHashUtil.ComputeHash(SystemType, SystemName)when a SystemName is supplied, otherwiseSystemHashUtil.Get(SystemType)(SD-BR-004). - Delegates:
SAIF.HashUtil. - Read
GetSecureConfigSetting(AuthKey, hash), split it on\|into user and password, and build anHttpClientHandlerwith aNetworkCredential(SD-BR-004). - Delegates:
SAIF.Framework.Core/IEnvironmentService. GetAsyncCached<T>: build the cache key{Type}-{url}-{ensureSuccess}[-bodyhash], execute through the Polly cache policy (or a NoOp policy whenUseCacheis false), then send a GET or a POST when a body is supplied (SD-BR-002).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([A derived client class issues a GET or cached GET/POST call.]) --> S1["`HttpClientBase`"]
S1 --> S2{"Rules satisfied?"}
S2 -->|Yes| EndOk([Result returned])
S2 -->|No| EndErr([Exception / empty result])
Failure and edge-case behavior¶
AuthKeyunset: the handler is built without aNetworkCredential(anonymous request).UseCachefalse: the NoOp policy bypasses caching entirely.
Related documentation¶
Sources¶
Data/SAIF.Data/Clients/HttpClientBase.cs