如何从httpclient调用中获取内容主体?
我一直在尝试弄清楚如何读取httpclient调用的内容,但似乎无法理解。我得到的响应状态是200,但是我不知道如何获得返回的实际Json,这就是我所需要的! 以下是我的代码: async Task<string> GetResponseString(string text) { var httpClient = new HttpClient(); var parameters = new Dictionary<string, string>(); parameters["text"] = text; Task<HttpResponseMessage> response = httpClient.PostAsync(BaseUri, new FormUrlEncodedContent(parameters)); return await response.Result.Content.ReadAsStringAsync(); } 我得到它只是从方法中调用它: Task<string> result = GetResponseString(text); 这就是我得到的 response Id = 89, Status = RanToCompletion, Method = "{null}", Result = "StatusCode: …