---
title: Authenticated/cached HTTP GET
summary: Provide a base HTTP client with lazy construction, credential resolution, and optional response caching for Guidewire API calls.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
operation_id: OP-SD-02
trigger: A derived client class issues a GET or cached GET/POST call.
---

# 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

1. Lazily create the `HttpClient`. The base URL comes from `IEnvironmentService.GetConfigSetting(UrlKey)` ([SD-BR-003](../business-rules.md#sd-br-003-service-base-url-must-come-from-environment-configuration)).
2. If `AuthKey` is set, compute the system hash: `SystemHashUtil.ComputeHash(SystemType, SystemName)` when a SystemName is supplied, otherwise `SystemHashUtil.Get(SystemType)` ([SD-BR-004](../business-rules.md#sd-br-004-credentials-retrieved-from-secure-setting-decrypted-with-system-hash)).
   - Delegates: `SAIF.HashUtil`.
4. Read `GetSecureConfigSetting(AuthKey, hash)`, split it on `\|` into user and password, and build an `HttpClientHandler` with a `NetworkCredential` ([SD-BR-004](../business-rules.md#sd-br-004-credentials-retrieved-from-secure-setting-decrypted-with-system-hash)).
   - Delegates: `SAIF.Framework.Core` / `IEnvironmentService`.
6. `GetAsyncCached<T>`: build the cache key `{Type}-{url}-{ensureSuccess}[-bodyhash]`, execute through the Polly cache policy (or a NoOp policy when `UseCache` is false), then send a GET or a POST when a body is supplied ([SD-BR-002](../business-rules.md#sd-br-002-get-responses-cached-via-polly-unless-caching-disabled)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
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
- `AuthKey` unset: the handler is built without a `NetworkCredential` (anonymous request).
- `UseCache` false: the NoOp policy bypasses caching entirely.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)


## Sources
- `Data/SAIF.Data/Clients/HttpClientBase.cs`
