Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# DateTime to UNIX timestamps
- C# HttpClient POST or PUT Json with content type application/json
- C# get results from Task.WhenAll
- Write to file from multiple threads async with C# and .NET Core
- Run tasks in parallel using .NET Core, C# and async coding
- Build .net core 6 projects with Azure Devops using yml files
- .NET API CORS: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header.NET API
Archive
Meta
Tag Archives: Response.Redirect
HttpClient follow 302 redirects with .NET Core
The HttpClient in .NET Core will not automatically follow a 302 (or 301) redirect. You need to specify that you allow this. use the HttpClientHandler to do this: Now your code will follow up to 2 redirections. Please note that … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged 301, 302, HttpClient, HttpClientHandler, Response.Redirect
Leave a comment
Response.Redirect throws an “Thread was being aborted”
Response.Redirect causes the browser to redirect to a different URL. It does so by sending a 302 – Object Moved to the browser, requesting it to do another roundtrip to the new page. Here is an example: But here … Continue reading
Posted in .net, c#
Tagged 302, Object moved, Response.Redirect, Thread was being aborted, ThreadAbortException
5 Comments