ParameterType = "header" does not fill the related property

Hello I have a question / issue about getting a parameter from the HTTP header.

This is my test code snippet:

   [Route("/test", "GET")]
   public class Test : IReturn
   {
         [ApiMember(Name = "HeaderTest", ParameterType = "header")]
         public string HeaderTest { get; set; }
   }

When ParameterType is set to “header”, the related HeaderTest property is not filled and remains null. However, if the type is “query” it works perfectly.

Currenlty I’m reading that value directly from Request.Headers, but I would like to know whether this is the desider behaviour or not.

Thanks.

The metadata attributes are only for annotating your Service, it doesn’t affect the binding behavior which is populated from the QueryString, Form Data or Request Body. You’ll still need to fetch the HTTP Headers from Request.Headers property.