ApiTester is a small Avalonia desktop application for crafting and sending HTTP requests. It provides a straightforward way to build requests, add headers and authentication, send requests, view responses, and persist request configurations.
- Build HTTP requests (method, URL, body).
- Add, remove, and persist headers.
- Select and apply authentication (None, Basic, Bearer, API key).
- Send requests and view responses.
- Copy the current request as a curl command or PowerShell snippet.
- Save and load request configurations to/from JSON files.
- Main UI:
Views/MainWindow.axaml - View model + behavior:
ViewModels/MainWindowViewModel.cs - Request builder (applies headers & auth):
Builders/MessageBuilder.cs - Models:
Models/HeaderEntry.cs,Models/SerializableHeader.cs,Models/HttpRequestPersistentDataModel.cs - Services:
Services/PersistenceService.cs,Services/FormatterService.cs
Prerequisites:
- .NET SDK (project targets .NET 8.0)
Build in the repo root:
dotnet buildRun the app:
dotnet run-
Headers: add rows and set name/value pairs; Content-Type is handled by the headers panel.
-
Authentication: choose a scheme and provide credentials/tokens before sending.
-
Copy actions: use the File/Tools menu or keyboard shortcuts to copy as curl or PowerShell.
-
Authentication:
- Choose a scheme, fill the fields and click
Send. - Basic auth uses
Authorization: Basic <base64(user:pass)>. - Bearer uses
Authorization: Bearer <token>. - ApiKey by default adds a header named
X-API-KEY; change the name in theAPI Keypanel if you need a different header or query parameter name.
If you paste a curl command (the app's "Copy as curl" output) into PowerShell, note that PowerShell's
-Headersparameter expects a hashtable / IDictionary rather than curl-style-Hstrings. If you prefer to run requests from PowerShell, you can convert the curl headers into a hashtable or use theInvoke-RestMethodapproach shown below.Quick PowerShell example (equivalent to a curl with JSON + header):
$uri = 'https://example.com/api' $body = '{"name":"value"}' $headers = @{ 'Content-Type' = 'application/json'; 'X-API-KEY' = 'your_key' } Invoke-RestMethod -Uri $uri -Method POST -Headers $headers -Body $body
- Choose a scheme, fill the fields and click
The app persists request configuration but avoids writing authentication secrets to saved JSON by default.
If you'd like any of these implemented, tell me which one and I will add it.
Generated from the current workspace on October 19, 2025. Use this README as a quick reference while developing and testing the app. Made with copilot
This project is licensed under the MIT License — see the LICENSE file in the repository root for details.
