Simple.API 1.6.3

.NET 6.0 .NET Core 3.1 .NET Standard 1.1
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Simple.API --version 1.6.3
NuGet\Install-Package Simple.API -Version 1.6.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Simple.API" Version="1.6.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Simple.API --version 1.6.3
#r "nuget: Simple.API, 1.6.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Simple.API as a Cake Addin
#addin nuget:?package=Simple.API&version=1.6.3

// Install Simple.API as a Cake Tool
#tool nuget:?package=Simple.API&version=1.6.3

SimpleAPI

.NET NuGet

A simple C# REST API client implementation

Table of Contents

Compatibility

Huge compatibility, currently supports:

  • .Net 6
  • .Net Core 3.1
  • .Net Framework 4.5
  • .Net Standard 1.1
    • .NetCore 1.0+
    • .Net Framework 4.5
    • Mono 4.6+
    • Xamarin.iOS 10.0+
    • Xamarin.Android 7.0+
    • UWP 8.0+
    • Unity 2018.1+

Installing

Get from NuGet and start testing

PM> Install-Package Simple.API

Use

How to GET a resource at https://httpbin.org/anything/42

// Base address is used to reuse the client object 
// but also do not have to repeat all the address
var client = new ClientInfo("https://httpbin.org/");

/* GET */
// no params
var get = await client.GetAsync<TestResponse>("anything");
// object builded param
var t = await client.GetAsync<TestResponse>("anything", new { id = "1234", value = 12.34 });
/* POST */
var post = await client.PostAsync<TestResponse>("anything", new { id = "1234", value = 12.34 });
/* And all others */
var putResponse = await client.PutAsync("anything", data);
var patchResponse = await client.PatchAsync("anything", data);
var deleteResponse = await client.DeleteAsync("anything");

The response object contains the original data, status code, request and response headers

if(!putResponse.IsSuccessStatusCode) 
  Console.WriteLine("â˜šī¸");
if(patchResponse.StatusCode == HttpStatusCode.Forbidden) 
  Console.WriteLine("🔒");
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.1 netstandard1.2 netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0
Windows Phone wpa81
Windows Store netcore netcore45 netcore451
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Simple.API:

Package Downloads
Simple.HAApi

A simple Home-Assistant Rest API Client

Sicoob.PIX

C# implementation for PIX with SICOOB

Sicoob.Shared

Base library for Sicoob APIs for C#

Sicoob.Conta

C# implementation for Bank Account with SICOOB

Sicoob.Cobranca

C# implementation for Billing with SICOOB

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.7.0-rc 59 1/30/2023
1.6.3 539 1/30/2023
1.6.2 803 1/24/2023
1.6.1 173 1/20/2023
1.6.0 163 1/19/2023
1.5.5 168 1/5/2023
1.5.4 272 8/4/2022
1.5.3 293 7/14/2022
1.5.2 672 7/9/2022
1.5.1 833 6/3/2022
1.5.0 673 4/18/2022
1.4.5.1 291 4/13/2022
1.4.5 312 4/9/2022
1.4.4.3 298 2/23/2022
1.4.4.2 421 2/23/2022
1.4.4.1 301 2/23/2022
1.4.4 280 2/18/2022
1.4.3 301 2/4/2022
1.4.0 305 1/13/2022
1.3.2 217 5/12/2021
1.3.1 221 5/12/2021
1.2.0 242 5/12/2021
1.1.0 220 5/3/2021
1.0.0 280 5/2/2021

See examples and documentation on the GitHub page https://github.com/RafaelEstevamReis/SimpleAPI