Returned An Error -502- Bad Gateway [portable] | System.net.webexception The Remote Server
If the upstream server is managed by another team or third party, the 502 error indicates a problem with their infrastructure. Your application is correctly reporting what the gateway returned.
An investigation into the System.Net.WebException: The remote server returned an error: (502) Bad Gateway If the upstream server is managed by another
string errorBody = reader.ReadToEnd(); Console.WriteLine($"Response body: errorBody"); Console.WriteLine($"Response body: errorBody")