sf-client
Core HTTP client infrastructure for Salesforce APIs.
This crate provides the foundational HTTP client with:
- Automatic retry with exponential backoff and jitter
- Compression support (gzip, deflate)
- Rate limit detection and handling
- ETag/conditional request support
- Connection pooling
- Request/response tracing
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
│ (sf-rest, sf-bulk, sf-metadata, sf-tooling) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ SalesforceClient │
│ - Holds credentials + HTTP client │
│ - Provides typed JSON methods (get_json, post_json, etc.) │
│ - Handles authentication headers │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ SfHttpClient │
│ - Raw HTTP with retry, compression, rate limiting │
│ - Request building with conditionals │
│ - Response handling │
└─────────────────────────────────────────────────────────────┘
Example
use ;
use SalesforceCredentials;
async