How to add and get Header values in WebApi

前端 未结 10 1603
既然无缘
既然无缘 2020-12-02 05:45

I need to create a POST method in WebApi so I can send data from application to WebApi method. I\'m not able to get header value.

Here I have added header values in

10条回答
  •  猫巷女王i
    2020-12-02 06:43

    try these line of codes working in my case:

    IEnumerable values = new List();
    this.Request.Headers.TryGetValues("Authorization", out values);
    

提交回复
热议问题