1

In a UWP application, I am using Refit REST library. I need my request header to be dynamic. For that I am following below approach:

[Get("/users/{user}")]
Task<User> GetUser(string user, [HeaderCollection] IDictionary<string, string> headers);

This is giving the error The type or namespace name 'HeaderCollection' could not be found (are you missing a using directive or an assembly reference?).

I am using the latest Refit version v5.2.4. Why is this happening? Do I need to import any additional namespace?

tahiat
  • 116
  • 8
  • 1
    Looks like `[HeaderCollection]` is part of an upcoming version 6 release, it isn't in the code for the 5.2.4 tag: https://github.com/reactiveui/refit/blob/v5.2.4/Refit/Attributes.cs – Martin Costello Jan 14 '21 at 12:20
  • Thanks @MartinCostello, I just checked that. I will try using the preview version. – tahiat Jan 14 '21 at 12:44

0 Answers0