Request-FP
An easy, memory-safe HTTP client for Free Pascal. One line per request, no objects to free, and sensible behaviour when the network is not.
- One line per requestHttp.Get, PostJSON, Download: records clean themselves up, no Free needed.
- Resilient by defaultSafe retries with backoff, Retry-After, typed timeout and network errors.
- Big files, small memoryStream downloads and uploads straight to and from disk, with progress.
- Sessions that behaveCookies follow Domain and Path; credentials never leak across hosts.
uses Request;
var
Response: TResponse;
begin
Response := Http.Get('https://api.example.com/users');
Response.RaiseForStatus;
WriteLn(Response.JSON.FindPath('[0].name').AsString);
end.
There is no client to create and nothing to free: TResponse cleans itself up, including its parsed JSON.
What you get
| Need | Request-FP |
|---|---|
| Quick calls | Http.Get, Post, PostJSON, PutJSON, PatchJSON, Delete, Head |
| Forms and files | PostForm, PostMultipart (files streamed from disk) |
| Large downloads | Http.Download(URL, FilePath, @ShowProgress) |
| Shared state | THttpSession: base URL, headers, cookies, auth |
| Flaky networks | Automatic retries for safe methods, Retry-After, timeouts |
| Clear failures | ETimeoutError, ENetworkError, ERequestError, or Try* results |
| HTTPS | OpenSSL 3 found automatically on Windows, Linux, and macOS |
Pick your path
- New here? Getting started takes you from install to a working session in a few minutes.
- Need a reminder? The cheat sheet fits on one screen.
- One-off calls: Stateless requests covers every
Httpmethod, downloads, retries, and the error policy. - Logins and APIs: Sessions keep cookies, headers, and credentials between calls.
- Curious about the internals? How it works explains retries, redirects, cookies, and streaming with diagrams.
- HTTPS trouble? Start with the SSL/HTTPS setup.
Requirements
- Free Pascal 3.2.2+ or Lazarus 4.8+
- Windows, Linux, or macOS
- OpenSSL 3 (or 1.1) for HTTPS only