Answers for "c# getting response content from post"

C#
0

c# getting response content from post

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;
}
Posted by: Guest on October-21-2020

C# Answers by Framework

Browse Popular Code Answers by Language