System.net.webexception The Remote Server Returned An Error -502- Bad Gateway Link
This is the most common cause. The backend server hosting the API or website you are trying to reach has run out of resources (CPU, RAM, or available threads).
catch (WebException ex)
