Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

ASP.NET MVC add headers and redirect to an external url

$
0
0

I need to write an small ASP.NET MVC website which sole purpose is to capture headers sent from a legacy website, add these headers to a request and redirect to a Blazor server app (including headers).

How can I add headers to a request and redirect to an external URL in a controller action?

I've tried HttpClient, WebClient and HttpWebRequest but none support redirecting.

I also tried:

Response.Headers.Add("Test", "Test redirect");Response.Redirect("https://mywebsite.com/", true);

The redirection works but the header is not added.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>