📜  c# 从帖子中获取响应内容 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:00.851000             🧑  作者: Mango

代码示例1
async Task GetResponseString(string text)
{
    var httpClient = new HttpClient();

    var parameters = new Dictionary();
    parameters["text"] = text;

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

    return contents;
}