MDACSHTTPServer 1.3.201.4014

There is a newer version of this package available.
See the version list below for details.
dotnet add package MDACSHTTPServer --version 1.3.201.4014
NuGet\Install-Package MDACSHTTPServer -Version 1.3.201.4014
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="MDACSHTTPServer" Version="1.3.201.4014" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MDACSHTTPServer --version 1.3.201.4014
#r "nuget: MDACSHTTPServer, 1.3.201.4014"
#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 MDACSHTTPServer as a Cake Addin
#addin nuget:?package=MDACSHTTPServer&version=1.3.201.4014

// Install MDACSHTTPServer as a Cake Tool
#tool nuget:?package=MDACSHTTPServer&version=1.3.201.4014

New Features in this Release

Added sugary class QuickResponse which can be retrieved from an IHTTPEncoderProxy using the Response method.

For example, it provides the sugary goodness to create a one line expression that sets the response code, response text, and then allows the chaining of additional header fields and finally either a UTF-8 encoded string or a binary stream. You can also call the method SendNothing to indicate you have no response body content to send. This is an improvement over the old style where individual methods were used and custom headers needed the utilization of a Dictionary<string, string> instance.

Behind the scenes, those same methods are called. If you want to ensure low latency you can always call the lower level primitive API, but if you need a more sugary and time saving way to create responses then the QuickResponse class was created just for that.

Also, included with the QuickResponse addition is the method ContentType_GuessFromFileName which grabs the extension for a filename on the string passed into it. This is then used to find an appropriate mime-type from an embedded database of mime-types and extentions. The example below shows the whole query_string treated as a filename for testing and if not present or valid the something.html is passed in to get back out a content type of text/html.

        public static async Task<Task> Action6(Object shandler, HTTPRequest request, Stream body, IProxyHTTPEncoder encoder)
        {
            return await encoder.Response(200, "ABCD")
                .ContentEncoding("UTF-8")
                .CacheControlDoNotCache()
                .ContentType_GuessFromFileName(request.query_string != null && request.query_string.Length > 0 ? request.query_string : "something.html")
                .SendString("A single little string");
        }

Example Code

You can find example code at the repository below:

https://bitbucket.org/kmcg3413/mdacshttpserverdemo

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.201.8021 1,171 1/8/2018
1.3.201.4014 1,143 1/4/2018
1.2.2 1,083 12/29/2017

ALPHA RELEASE