HttUnicorn 0.0.2-alfa

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

// Install HttUnicorn as a Cake Tool
#tool nuget:?package=HttUnicorn&version=0.0.2-alfa&prerelease

HttUnicorn v0.0.2-alfa

NuGet

Designed to help C# programmers creating HTTP Requests, this is The Hypertext Transfer Unicorn 🦄

Usage

  1. Install our NuGet Package;
  2. Follow the examples below

Get

List<Todo> todos = await new HttUnicornSender()
                      .SetUrl("http://localhost:3000/todos/")
                      .GetAsync<List<Todo>>();
                      
string todoJson = await new HttUnicornSender()
                    .SetUrl("http://localhost:3000/todos/")
                    .GetAsync();

Post

await new HttUnicornSender()
  .SetUrl("http://localhost:3000/todos/")
  .PostAsync<Todo, Todo>(new Todo
  {
    Completed = true,
    Title = "todo",
    UserId = 36
  });
//This one will return the generated Todo, wich type is specified in the first type parameter.

Put

Todo updatedTodo = await new HttUnicornSender()
                    .SetUrl("http://localhost:3000/todos/" + todo.id)
                    .PutAsync<Todo, Todo>(todo);
//This one will return the edited Todo, wich type is specified in the first type parameter.

Delete

await new HttUnicornSender()
  .SetUrl("http://localhost:3000/todos/")
  .DeleteAsync(key);

MyApiResponse response = await new HttUnicornSender()
                          .SetUrl("http://localhost:3000/todos/")
                          .DeleteAsync<MyApiResponse>(key);
//This one is for situations when the requested API returns an object in the body of the response.

Contact me

Tyler Mendes de Brito - @tylerbryto (Github) – colorigotica (Twitter) – tyler.brito99@gmail.com

Contributing

See git flow cheatsheet.

  1. Fork it (https://github.com/tylerbryto/httunicorn/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request
  6. Wait for my response

🦄

Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  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.

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.1.0 784 11/15/2018
0.0.2-alfa 552 10/14/2018

v0.0.2-alfa GET, POST, PUT and DELETE methods added