这篇文章发布于 367 天前,部分信息可能已经发生变化。
汇联易接口POSTMAN可以调通,C# HttpClient报错500.
{"timestamp":"2023-12-21T05:49:46.362+0000","path":"/gateway/oauth/token","status":500,"error":"Internal Server Error","message":"","requestId":"649c231a"}
C# HttpClient测试好几种调用方法都不行,估计是POSTMAN的http post与C# HttpClient post有细节差异,启用Charles抓包分析
Charles抓包分析结果:C# HttpClient post头部多了:Expect:100-continue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.ExpectContinue = false;
}