Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
Fetch API - get custom response header not working in ASP.NET MVC

I'm unable to get x-Token-Expired header in client-side in fetch request. I have added the header from server-side

filterContext.HttpContext.Response.Headers.Add("x-Token-Expired", "true");
filterContext.HttpContext.Response.Headers.Add("Access-Control-Expose-Headers", "*");

In client-side, looping through the headers , I am not able to get x-Token-Expired header.

 let tokenExpiredHeader = response.headers.get('x-Token-Expired');
 for (var pair of response.headers.entries()) {
   console.log(pair[0] + ': ' + pair[1]);
 }

This is what I get in console

This is what I get in log

Although the above said header is present in response header list Network

Thanks in advance !!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!