Halifax.Http 0.0.3

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

// Install Halifax.Http as a Cake Tool
#tool nuget:?package=Halifax.Http&version=0.0.3
Package Name NuGet
Halifax.Api     NuGet
Halifax.Core     NuGet
Halifax.Domain     NuGet
Halifax.Http     NuGet

Halifax Service Foundation

Simplistic libraries for complex projects. Halifax libraries are designed to speed up API service development process by encapsulating common functionality required for all microservices, allowing developers to focus on the business logic instead of copy-pasting the boilerplate code from project to project. The libraries are focussed on the following aspects of any application:

  • ✅ Exception handling
  • ✅ API models
  • ✅ Swagger
  • ✅ JWT Auth
  • ✅ Logging
  • ✅ CORS

Installation

Install the API library using nuget package with Package Manager Console:

Install-Package Halifax.Api

Or using .NET CLI:

dotnet add package Halifax.Api

Getting Started

Please refer to the Peggy's Cove example API project Startup.cs file for more details but basically all you need is to have this in your startup class:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddHalifax();
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        app.UseHalifax();
    }
}

This enables routing with controllers and exception handling.

Models

It's very beneficial if all API responses follow the same format. In order to achieve it there is a model called ApiResponse. It's designed to return response data, empty data or error information in the same consistent format. Here are the main use cases:

// Return API response with your model
return ApiResponse.With(model);

// Return empty API response
return ApiResponse.Empty;

When API response is used for all APIs in the project the response will always be of a format:

{
    data: {...} // your model
    success: true/false,
    error: { // null if successful
        type: "ArgumentNullException",
        message: "Email is required",
        trace: "(126) ArgumentNullException was thrown ... (typical exception stack trace)"
    }
}

MIT License

Copyright (c) 2020 Andrei M

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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 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. 
Compatible target framework(s)
Additional computed target framework(s)
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
2.0.7 88 9/14/2023
2.0.6 141 8/16/2023
2.0.5 152 7/9/2023
2.0.4 255 3/23/2023
2.0.3 174 3/20/2023
2.0.2 163 3/20/2023
2.0.1 339 2/24/2023
2.0.0 372 12/21/2022
1.0.3 554 10/16/2022
1.0.2 374 9/21/2022
1.0.1 443 8/19/2022
1.0.0 472 7/11/2022
0.0.9 494 6/22/2022
0.0.8 365 6/22/2022
0.0.7 355 6/22/2022
0.0.6 490 6/10/2022
0.0.5 342 6/10/2022
0.0.4 350 6/10/2022
0.0.3 394 6/2/2022
0.0.2 350 6/2/2022
0.0.1 351 6/2/2022

v0.x.x - Initial release