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
public async Task<string> DoCurlAsync() | |
{ | |
using (var httpClient = new HttpClient()) | |
using (var httpResonse = await httpClient.GetAsync("https://www.bynder.com").ConfigureAwait(false)) | |
{ | |
return await httpResonse.Content.ReadAsStringAsync(); | |
} | |
} |
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 bynderContents = DoCurlAsync().Result; |
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 bynderContents = await DoCurlAsync(); |
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 | |
{ |
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
while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0) | |
{ | |
// No errors are handled, for simplicity purposes. | |
TranslateMessage(&msg); | |
DispatchMessage(&msg); | |
} |
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
public async Task<string> DoCurlAsync() | |
{ | |
using (var httpClient = new HttpClient()) | |
using (var httpResponse = await httpClient.GetAsync("https://www.bynder.com").ConfigureAwait(false)) | |
{ | |
return await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); | |
} | |
} |
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
public async Task<string> DoCurlAsync() | |
{ | |
using (var httpClient = new HttpClient()) | |
using (var httpResonse = await httpClient.GetAsync("https://www.bynder.com")) | |
{ | |
return await httpResonse.Content.ReadAsStringAsync(); | |
} | |
} |