Answers for "c# getasync response"

C#
1

c# getasync response

async Task<string> GetResponseString(string text)
{
    var httpClient = new HttpClient();

    var parameters = new Dictionary<string, string>();
    parameters["text"] = text;

    var response = await httpClient.PostAsync(BaseUri, new FormUrlEncodedContent(parameters));
    var contents = await response.Content.ReadAsStringAsync();

    return contents;
}

var finalResult = await GetResponseString(text);
Posted by: Guest on April-04-2020

C# Answers by Framework

Browse Popular Code Answers by Language