Skip to content

Instantly share code, notes, and snippets.

View fmaar's full-sized avatar

Francisco Martinez fmaar

View GitHub Profile
@Delaire
Delaire / CoreTools.cs
Last active June 17, 2025 08:49
UWP, C# - Retrieve the redirect url using HttpClient from the Headers of the Response - [HttpClient,C#]
public static class CoreTools
{
public static async Task<string> GetRedirectedUrl(string url)
{
//this allows you to set the settings so that we can get the redirect url
var handler = new HttpClientHandler()
{
AllowAutoRedirect = false
};
string redirectedUrl = null;