You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BaseLocation("api/customer")]publicinterfaceICustomerApi{[Get("{id}")]Task<Customer>GetCustomer(intid);}
....
var customerApi = Api.For<ICustomerApi>("https://localhost:1111/");awaitcustomerApi.GetCustomer(9);// => HTTP GET https://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 (which means Web Anchor won't work in code distributed through the Windows Phone App Store or whatever it is called), ReFit generates code at compile time. There is also RestSharp which I have never tried. It seems to work in a very different way from both ReFit and Web Anchor and it doesn't look extensible at all! (restsharp/RestSharp#932)