I have the following code:
WebClient wc = new WebClient(); string result; try { result = await wc.DownloadStringTaskAsync( new Uri( \"http://badurl\" ) );
Use C# 6.0. see this Link
public async Task SubmitDataToServer() { try { // Submit Data } catch { await LogExceptionAsync(); } finally { await CloseConnectionAsync(); } }