Forum Discussion
Web.Contents unencoding forward slahes
Hi v-huizhn-msft,
Thanks for your response, however I can't seem to find any reference to people trying to encode a '/' in Web.Contents.
I firmly believe this is a problem with the Web.Contents function and for some reason it is unencoding any '%2F' into a '/' even though I don't want it to.
Example power query:-
let
URL = "https://www.example.com/en-gb",
Encode = Uri.EscapeDataString(URL),
Source = Web.Contents("https://dataapi.com/site/" & Encode & "/dataEndpoint"),
in
SourceThe expected result from this power query should be:-
https://dataapi.com/site/https%3A%2F%2Fwww.example.com%2Fen-gb/dataEndpoint
But instead the actual call from Web.Contents is to:-
https://dataapi.com/site/https%3A//www.example.com/en-gb/dataEndpoint
Which is wrong!
How can I force Web.Contents to keep the '%2F' encoded and not to unencode it to a '/'?
Thanks,
Richard
I've used fiddler to see what URL is going out from Power BI and can confirm that it is unencoding the '%2F' to a '/'.
Any idea what I can do to stop this?
Thanks,
Richard