消息头如此,加了一个 参数
Authorization Bearer XR8JYDY-GETMVC1-NAWZGXQ-6DVJMKX

消息体
{"message":"健康产品","mode":"query"}
用postman可以成功,但是用asp.net没有返回值,代码如下,请帮忙检查下错在哪里
```c#
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class AnyThingLLMClient
{
private readonly HttpClient _httpClient;
private readonly string _apiKey;
public AnyThingLLMClient(string apiKey)
{
_httpClient = new HttpClient();
_apiKey = apiKey;
}
public async Task<string> CallAnyThingLLMAsync(string prompt)
{
var requestUrl = "http://localhost:3001/api/v1/workspace/customer/chat"; // 替换为实际的API URL
var requestBody = new
{
message = prompt,
mode = "query"
};
var jsonContent = JsonConvert.SerializeObject(requestBody);
var httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json");
//_httpClient.DefaultRequestHeaders.Clear();
//_httpClient.DefaultRequestHeaders.Add("CustomHeader", "HeaderValue");
//_httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "XR8JYDY-GETMVC1-NAWZGXQ-6DVJMKX");
_httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer XR8JYDY-GETMVC1-NAWZGXQ-6DVJMKX");
var response = await _httpClient.PostAsync(requestUrl, httpContent);
if (response.IsSuccessStatusCode)
{
var responseContent = await response.Content.ReadAsStringAsync();
return responseContent;
}
else
{
throw new HttpRequestException("Error: {response.StatusCode}");
}
}
}
```c#