How to convert http Web Request to asynchronous requests using aysnc and await

后端 未结 1 817
南方客
南方客 2020-12-22 05:09

I have a simple request function that logs a user in. I just learned about aysnc method (I am a C# beginner) and saw that requests can be made using async and await. But I a

相关标签:
1条回答
  • 2020-12-22 05:33

    The absolute easiest way is to replace HttpWebRequest with HttpClient.

    You'll also want to use an asynchronous method signature:

    public static async Task<string> LogInAsync(string email, string password)
    
    0 讨论(0)
提交回复
热议问题