0

I want to fetch token data from header in asp.net core, How can I do that? in PHP I use $_SERVER["HTTP_TOKEN"] but in asp.net core I don't know how can I do that. I'm beginner in ASP.net Core API. I searched a lot in internet but I couldn't find any solution

1 Answer 1

1

To get header value in asp.net core try the code below

StringValues headerValue;  
Request.Headers.TryGetValue("HTTP_TOKEN", out headerValue);  
var headerValueResult= headerValue.FirstOrDefault(); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.