You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

C#请求SSE端点超时问题排查求助

SSE流式数据获取问题排查

我已查阅Stack Overflow上的两个相关问题,排除了套接字关闭的问题。尝试从SSE端点流式获取数据时,已参考相关博客添加了必要的apikey请求头,但仍遇到以下异常情况:

  • 使用curl命令可正常获取流式数据
  • Postman返回200状态码,但无法获取到SSE数据
  • 我的C#代码在获取响应前就超时了,通过Fiddler可拦截到200响应;尝试将await改为.Result或.GetAwaiter().GetResult()均无改善,调整请求头也未解决问题

curl命令(可正常运行)

curl -v  http://<ip>:<port>/api/v3/ble/stream/packets -H "apikey: <key>"

我的C#代码

var request = new HttpRequestMessage(HttpMethod.Get, new Uri($"{APIGW_URL}/{streamingEndpoint}"));
request.Headers.Add("apikey", APIKEY);
request.Headers.Add("Accept", "*/*");

logger.LogInformation("Sending request {method} to {url}:", request.Method, request.RequestUri);

HttpResponseMessage response = await client.SendAsync(request);
logger.LogInformation("Received response with status code {statusCode} and headers :");

Fiddler拦截到的响应

HTTP/1.1 200 OK
Content-Type: application/json
Grpc-Metadata-Content-Type: application/grpc
Date: Thu, 12 Oct 2023 16:43:00 GMT
Transfer-Encoding: chunked

内容的提问来源于stack exchange,提问作者MikeF

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 19:12:46