Refit 1.2.0
What's New
Request Headers
Thanks to @bennor, Refit now supports adding request headers to both individual methods as well as to entire classes via the [Header]
attribute. Here's an example:
[Headers("X-Emoji: :rocket:")]
public interface IGitHubApi
{
[Get("/users/list")]
Task<List> GetUsers();
[Get("/users/{user}")]
[Headers("X-Emoji: :smile_cat:")]
Task<User> GetUser(string user);
[Post("/users/new")]
[Headers("X-Emoji: :metal:")]
Task CreateUser([Body] User user, [Header("X-Emoji")] string emoji);
}