Common implementation of RestEase-based REST clients.
Add Syncromatics.Clients.RestEase
package to your project:
dotnet add package Syncromatics.Clients.RestEase
Then use it to instantiate a REST client
var client = typeof(IMyRestEaseApi).GetRestClient("https://example.com");
try
{
return await client.GetThingAsync();
}
catch (ClientException<ProblemDetails> clientExceptionWithProblemDetails)
{
Console.Error.WriteLine(clientExceptionWithProblemDetails.Error.Title);
}
catch (ClientException clientException)
{
Console.Error.WriteLine($"{clientException.StatusCode}: {clientException.Message}}");
}
This project is class library built with .NET Core. To build:
dotnet build
We are committed to fostering an open and welcoming environment. Please read our code of conduct before participating in or contributing to this project.
We welcome contributions and collaboration on this project. Please read our contributor's guide to understand how best to work with us.
This software is made available by GMV Syncromatics Engineering under the MIT license.