https://github.com/snixtho/hawf
HTTP API Wrapper Framework - Quickly build API wrappers and clients
https://github.com/snixtho/hawf
api api-client csharp framework http
Last synced: about 1 month ago
JSON representation
HTTP API Wrapper Framework - Quickly build API wrappers and clients
- Host: GitHub
- URL: https://github.com/snixtho/hawf
- Owner: snixtho
- License: apache-2.0
- Created: 2022-06-07T15:08:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-12T11:46:39.000Z (7 months ago)
- Last Synced: 2025-12-03T18:46:38.203Z (3 months ago)
- Topics: api, api-client, csharp, framework, http
- Language: C#
- Homepage:
- Size: 129 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hawf
[](https://github.com/snixtho/hawf/actions/workflows/run-tests.yml) [](https://github.com/snixtho/hawf/actions/workflows/publish-release.yml) 
Http API Wrapper Framework - Quickly build API wrappers and clients
# Installation
You can find the package on [NuGet](https://www.nuget.org/packages/Hawf/) or install through command line:
```
dotnet add package Hawf
```
# Basic Usage
Creating an API is as simple as inherting the `ApiBase` and annotate the `ApiClient` attribute:
```csharp
[ApiClient("https://api.mywebsite.com")]
public class MyApi : ApiBase
{
public Task MyApiCallAsync() => GetStringAsync("/myendpoint");
}
```
You can then instantiate the class and call the api endpoint:
```csharp
var api = new MyApi();
var response = await api.MyApiCallAsync();
Console.WriteLine(response);
```
This is only a very basic example of how it works. The framework provides various convenient methods and tools to quickly create a complete client for your API.
# Features
- Quickly define your API endpoints into client code with a rich builder API.
- Supports automatic JSON serialization/deserialization.
- Handles authentication and authorization of your endpoints.
- Can avoid rate limits to trigger on APIs
- Based on the Task Asynchronous Programming (TAP) pattern.
- Response caching.
- Standardizes the code structure to keep it readable and maintainable.
For a complete overview of all the features, check out the documentation.
# Documentation
Check out the main documentation [here](docs/).