https://github.com/dragonfruitnetwork/rest-client
A lightweight, extensible HTTP/REST framework for .NET
https://github.com/dragonfruitnetwork/rest-client
http-client http-request json source-generator
Last synced: 12 days ago
JSON representation
A lightweight, extensible HTTP/REST framework for .NET
- Host: GitHub
- URL: https://github.com/dragonfruitnetwork/rest-client
- Owner: dragonfruitnetwork
- License: mit
- Created: 2019-11-17T17:01:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-12-23T20:07:21.000Z (about 1 month ago)
- Last Synced: 2025-12-25T04:17:01.422Z (about 1 month ago)
- Topics: http-client, http-request, json, source-generator
- Language: C#
- Homepage: https://dragonfruit.network/wiki/rest-client
- Size: 672 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# DragonFruit.Data
A lightweight, extensible HTTP/REST framework for .NET
[](https://nuget.org/packages/DragonFruit.Data)
[](https://discord.gg/VA26u5Z)
### Overview
DragonFruit.Data is a HTTP REST client for .NET that is designed to be easy to use and acts as the main web communication system for many DragonFruit products, including internal tools.
### Usage/Getting Started
The easiest way to get started is to install the [NuGet package](https://nuget.org/packages/DragonFruit.Data), create an `ApiClient` and start making requests.
For more information, see the [wiki](https://dragonfruit.network/wiki/rest-client) and the [getting started guide](https://dragonfruit.network/wiki/rest-client/getting-started).
#### `SteamRequest.cs`
```csharp
using DragonFruit.Data;
using DragonFruit.Data.Requests;
namespace DataExample;
public partial class SteamNewsRequest : ApiRequest
{
public override string RequestPath => "https://api.steampowered.com/ISteamNews/GetNewsForApp/v0002";
public SteamNewsRequest(int appId)
{
AppId = appId;
}
[RequestParameter(ParameterType.Query, "appid")]
public int AppId { get; set; }
[RequestParameter(ParameterType.Query, "count")]
public int? Count { get; set; }
[RequestParameter(ParameterType.Query, "maxlength")]
public int? MaxLength { get; set; }
[RequestParameter(ParameterType.Query, "format")]
protected string Format => "json";
}
```
#### `Program.cs`
```csharp
using System.Threading.Tasks;
using DragonFruit.Data;
using DragonFruit.Data.Serializers;
namespace DataExample;
public class Program
{
internal static ApiClient Client = new ApiClient
{
UserAgent = "DataExample"
};
public static async Task Main(string[] args)
{
var tf2NewsRequest = new SteamNewsRequest(440);
var tf2News = await Client.PerformAsync(tf2NewsRequest);
// tf2News is now a JsonObject that can be manipulated as needed
}
}
```
### License
The project is licensed under MIT. Refer to [license.md](license.md) for more information.