Skip to content

sebastianappler/Web-Anchor

 
 

Repository files navigation

Web Anchor

Build status NuGet version
Web Anchor provides easy, clean and type-safe access to web resources.

Install

To install Web Anchor, run the following command in the Package Manager Console

PM> Install-Package WebAnchor

Use

[BaseLocation("api/customer")]
public interface ICustomerApi
{
    [Get("/{id}")]
    Task<Customer> GetCustomer(int id);
}

....

var customerApi = Api.For<ICustomerApi>("http://localhost:1111/");
await customerApi.GetCustomer(9);

// => HTTP GET http://localhost:1111/api/customer/9

Does this get you started? Head over to the wiki for more coolness.

Collaborate

Web Anchor is open-sourced to the max and free to use and modify, even for commercial projects. We would love to hear from you if you're using Web Anchor.

Also, if you like (or hate) Web Anchor so much that you would like to contribute in any way, please visit us on GitHub. :)

Alternatives

Although Web Anchor is off course the best framework for accessing web apis, there are alternatives in the .Net ecosystem you might be interested in. Web Anchor is more or less inspired by ReFit. ReFit uses a completely different approach on how the implementation of your api interfaces is created. While Web Anchor generates an implementation in runtime using Castle Windsor DynamicProxy, ReFit generates code at compile time. ReFit says it supports platforms like Xamarin. Web Anchor has only been tested on windows desktops and servers. If you´ve used Web Anchor successfully on any other platform, let us know! :) There is also RestSharp which I have never tried. It seems to work in a very different way from both ReFit and Web Anchor

About

A type-safe .NET-library for consuming web APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%