Created
December 9, 2016 15:50
-
-
Save JoanM/03c63eddb10db365647c1aa4eac28a6d to your computer and use it in GitHub Desktop.
Bynder Curl Async
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var currentContext = SynchronizationContext.Current; | |
var httpResponseTask = httpClient.GetAsync("https://www.bynder.com"); | |
httpResponseTask.ContinueWith(delegate | |
{ | |
if (currentContext == null) | |
{ | |
return await httpResonse.Content.ReadAsStringAsync(); | |
} | |
else | |
{ | |
currentContext.Post(delegate { | |
await httpResonse.Content.ReadAsStringAsync(); | |
}, null); | |
} | |
}, TaskScheduler.Current); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment