StatsHelix.Charizard
0.10.3
dotnet add package StatsHelix.Charizard --version 0.10.3
NuGet\Install-Package StatsHelix.Charizard -Version 0.10.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="StatsHelix.Charizard" Version="0.10.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StatsHelix.Charizard --version 0.10.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StatsHelix.Charizard, 0.10.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 StatsHelix.Charizard as a Cake Addin
#addin nuget:?package=StatsHelix.Charizard&version=0.10.3
// Install StatsHelix.Charizard as a Cake Tool
#tool nuget:?package=StatsHelix.Charizard&version=0.10.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
StatsHelix.Charizard
The StatsHelix Charizard web framework.
Example
using System;
using System.Net;
using System.Threading.Tasks;
using StatsHelix.Charizard;
using static StatsHelix.Charizard.HttpResponse;
namespace TestApp
{
public class Program
{
public static void Main(string[] args)
{
var server = new HttpServer(new IPEndPoint(IPAddress.Loopback, 80), typeof(Program).Assembly);
// server.UnexpectedException += e => Console.WriteLine(e);
server.Run().Wait();
}
}
[Controller]
public class TestController
{
// GET /Test/Static HTTP/1.1
public static HttpResponse Static(HttpRequest req)
{
// Return any HttpResult (see that class for what's possible)
return String("Success.");
}
// GET /Test/Sync HTTP/1.1
public HttpResponse Sync(HttpRequest req)
{
// Charizard instantiates one controller object per request for instance actions
return String("Success.");
}
// GET /Test/Async HTTP/1.1
public async Task<HttpResponse> Async(HttpRequest req)
{
// Async works
return await Task.FromResult(String("Success."));
}
// GET /Test/Params?name=Hi&id=12 HTTP/1.1
public HttpResponse Params(string name, int id)
{
// We can use parameters
return Json(new FooType { Name = name, Id = id });
// Response:
// Content-Type: application/json
// { "Name": "Hi", "Id": 12 }
}
// POST /Test/Post HTTP/1.1
// POST-Body:
// { "Name": "Hello", "Id": 13 }
public HttpResponse Post(FooType foo)
{
// Post bodies are JSON-encoded, so they are easy to generate
// from any client-side language. Deep objects are no problems,
// anything that can be handled by Newtonsoft.Json is fine.
// We don't support HTML-Forms, since they are - on our opionion - outdated.
return String("foo.Name: " + foo.Name + " --- foo.Id: " + foo.Id);
}
// Dummy type for demonstration
public class FooType
{
public string Name { get; set; }
public int Id { get; set; }
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Newtonsoft.Json (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Add PageNotFound-Handler that handles 404s