Poster.DependencyInjection 0.0.2

Install-Package Poster.DependencyInjection -Version 0.0.2
dotnet add package Poster.DependencyInjection --version 0.0.2
<PackageReference Include="Poster.DependencyInjection" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Poster.DependencyInjection --version 0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Poster.DependencyInjection, 0.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Poster.DependencyInjection as a Cake Addin
#addin nuget:?package=Poster.DependencyInjection&version=0.0.2

// Install Poster.DependencyInjection as a Cake Tool
#tool nuget:?package=Poster.DependencyInjection&version=0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


This library helps to build a HTTP service very quickly with embedded serialization and deserialization. You just need create interface, mark HTTP methods with attributes (GET, POST, DELETE etc.) and Poster will create your interface implementation for you.

HTTP service implementation example

    public interface IOrderService
        public Task<Order> GetOrderAsync(int id);

        public Task CreateOrder([Body] Order order);
Instrance creation
            var poster = new PosterBuilder()
                // Here you can add build configuration

            var orderService = poster.BuildService<IOrderService>();
            var order = await orderService.GetOrderAsync(10);

Supported HTTP requests

Poster support all main request types: GET, POST, PUT, PATCH, DELETE. You need to mark your method in service interface via GetAttribute, PostAttribute, PutAttribute, PatchAttribute or DeleteAttribute accordingly. Each http attribute has constructor with url parameter. Service will do request to this url addres. Url supports inline parameters. Parameter should be covered in bracket {} and method should contains this parameter as argument with the same name.

Method with parameters example
        Task<Order> GetOrderAsync(int id);

        Task<Message> CreateMessageAsync(string testParam, double param);
Method return requirements

Each method in your service should returns Task or Task<TResponseModel>.

Http request body

If you want to send request body, you can add it to your method as argument and mark it via BodyAttribute

Request body example
        Task CreateOrderAsync([Body] Order order);

Warning: only POST, PUT, PATCH methods support request body.

There are no supported framework assets in this 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
0.0.2 141 1/13/2021