❔ Local Environment throwing exception when calling HttpClient.GetStringAsync

I am running the below code via Visual Studio Code, and a "The requested address is not valid in its context. (www.mypublicwebsite.com:443)" exception is thrown, an inner SocketException with error code 10049 is thrown too but I cannot figure out why it is called, I believe my local is setup to allow the program to connect to public internet sites.

using (var httpClient = new HttpClient()) { await httpClient.GetStringAsync("https://www.mypublicwebsite.com"); }
Was this page helpful?