SAPI 10.0.0

dotnet add package SAPI --version 10.0.0
NuGet\Install-Package SAPI -Version 10.0.0
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="SAPI" Version="10.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SAPI --version 10.0.0
#r "nuget: SAPI, 10.0.0"
#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 SAPI as a Cake Addin
#addin nuget:?package=SAPI&version=10.0.0

// Install SAPI as a Cake Tool
#tool nuget:?package=SAPI&version=10.0.0

SAPI - Simple API

Nuget NuGet GitHub

SAPI is a library for creating APIs with C#. It's simple by design and allows for a lot of flexibility.

Installation

Add as dependency in NuGet

Install-Package SAPI -ProjectName <project>

In your preferred IDE: SAPI in rider's NuGet PM

By downloading and referencing the DLL in your project.

Usage

For detailed explanation You can also see wiki

// Program.cs
using SAPI;
using SAPI.Endpoints;
using Project.Endpoints;

public static void Main(string[] args)
{
    // Init SAPI
    Server sapi = new();
    
    // Mount endpoints(routes)
    sapi.MountEndpoint(new Ping());
    
    
    // Start SAPI
    sapi.Start();
}
// Endpoints/Ping.cs
using System.Net;
using SAPI.Endpoints;
using SAPI.Utilities;

namespace Project.Endpoints
{
    public class Ping : IEndpoint
    {
        public string url { get; } = "ping";
        public Method method { get; } = Method.GET;

        public override void Task(ref HttpListenerRequest request, ref HttpListenerResponse response, Dictionary<string, string> parameters)
        {
            Console.WriteLine("Ping!");
            
            Utilities.HtmlResponse("Pong!", ref response);
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SAPI:

Package Downloads
SharpSSR

SharpSSR is a web framework for building Server Side Rendered apps.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
10.0.0 344 7/26/2023
9.1.0 197 5/15/2023
9.0.0 171 5/4/2023
8.0.0 153 5/1/2023
7.0.0 176 4/25/2023
6.0.0 203 3/11/2023
6.0.0-experimental 137 2/8/2023
5.0.1 205 12/24/2022
5.0.0 196 12/6/2022
4.0.0 200 11/9/2022
3.0.0 205 11/6/2022
2.2.0 195 10/31/2022
2.1.0 227 10/5/2022
2.0.0 218 9/28/2022
1.2.0 249 9/15/2022
1.1.0 264 9/14/2022
1.0.0 282 9/14/2022