Overview
SIMPLE_HTTP provides a clean HTTP client for Eiffel with automatic retry, cookie management, and a fluent builder API.
Key Features
- All HTTP methods (GET, POST, PUT, DELETE, HEAD, PATCH)
- JSON request/response support
- Authentication (Bearer, Basic, API key)
- Automatic retry with exponential backoff
- Cookie management and request interceptors
Quick Start
Installation
<library name="simple_http" location="$SIMPLE_HTTP/simple_http.ecf"/>
Basic Usage
local
http: SIMPLE_HTTP
response: SIMPLE_HTTP_RESPONSE
do
create http.make
response := http.get ("https://api.example.com/data")
if response.is_success then
print (response.body)
end
end
API Reference
| Feature | Description |
|---|---|
get (url) | GET request |
post (url, data) | POST request |
put (url, data) | PUT request |
delete (url) | DELETE request |
set_bearer_token | Set Bearer auth |
set_basic_auth | Set Basic auth |
enable_retry | Enable retry |
enable_cookies | Enable cookies |