Skip to content
Mattias Nordqvist edited this page Nov 20, 2017 · 7 revisions

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

Nice, isn´t it? Read up on the the Basics of Web Anchor and you´ll see how it becomes even nicer. 👍

Documentation (v6.1.0)

  1. Getting started
  2. Basics (Http GET & Base Location)
  3. Basics pt. 2 (POST/PUT/DELETE, HttpResponseMessage, Exceptions, HttpClient, IDisposable)
  4. Building an HttpRequestMessage
  5. Parameter attributes
  6. Handling responses
  7. ApiSettings
  8. Typical setup (Develop/Test/Production & Mocking)
  9. Logging
  10. Testing
  11. Generic Api
  12. Multipart
Clone this wiki locally