The ChannelAdam Nancy Library

Overview

This is an open source (Apache License 2.0) .NET Standard 2.0 code library that provides some helpers and extensions for the lightweight Nancy web framework.

This library provides a foundation for the ChannelAdam Nancy SOAP Library.

Getting Started

NuGet Package Installation

To install the ChannelAdam.Nancy NuGet package run the following command in the Package Manager Console:

1PM> Install-Package ChannelAdam.Nancy

Reference

NancyRequestHelper

The NancyRequestHelper static class provides a helper method for operating on a Nancy Request.

The NancyRequestHelper static class has one method:

  • string GetRequestBodyAsString(Request request) - to extract the body of the Nancy Request as a string

This is also surfaced as an extension method on the Nancy Request class for which you will need a using statement for ChannelAdam.Nancy.

NancyResponseHelper

The NancyResponseHelper static class provides a helper method for operating on a Nancy Response.

The NancyResponseHelper static class has one method:

  • string GetResponseContentAsString(Response response) - to extract the contents of the Nancy Response as a string

This is also surfaced as an extension method on the Nancy Response class for which you will need a using statement for ChannelAdam.Nancy.

NancyResponseFactory

The NancyResponseFactory static class provides helper methods for creating a Nancy Response.

The NancyResponseFactory static class has two methods:

  • Response CreateFromEmbeddedResource(string resourceName, HttpStatusCode httpStatusCode, string contentType) - to create a Nancy Response from an embedded resource

  • Response CreateFromString(string responseValue, HttpStatusCode httpStatusCode, string contentType) - to create a Nancy Response from a given string

Please leave below any comments, feedback or suggestions, or alternatively contact me on a social network.

comments powered by Disqus