I have an URL containing several slash characters (/
) as a part of the filename (not the URL). But when I send http request, the percent-encoded %2F
If you're going to use PowerShell you can also do Workaround 1 in pure PowerShell:
function UrlFix([Uri]$url) {
$url.PathAndQuery | Out-Null
$m_Flags = [Uri].GetField("m_Flags", $([Reflection.BindingFlags]::Instance -bor [Reflection.BindingFlags]::NonPublic))
[uint64]$flags = $m_Flags.GetValue($url)
$m_Flags.SetValue($url, $($flags -bxor 0x30))
}
UrlFix $ChromeUrl
Invoke-WebRequest -Uri $ChromeUrl -OutFile $FilePath -Verbose