Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# HttpClient POST or PUT Json with content type application/json
- C# get results from Task.WhenAll
- C# Get expiry timestamp from JWT token
- Run tasks in parallel using .NET Core, C# and async coding
- Handling "415 Unsupported Media Type" in .NET Core API
- Using C# HttpClient from Sync and Async code
- ASP.Net Core API - "'s' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
Archive
Meta
Tag Archives: 302
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
Sitecore 404 without 302
It’s a well known issue that when Sitecore displays a 404 page, it’s done by doing a 302 redirect to the 404 page, hence the 302 status code is thrown before the 404. The behavior is partially because of the … Continue reading
Posted in c#, General .NET, Sitecore 6
Tagged 302, 404, httpRequestBegin, Pipeline, Sitecore, TrySkipIisCustomErrors
14 Comments
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