This commit is contained in:
2025-05-13 11:49:57 +08:00
parent d4ed9c3f78
commit fd91cfe8c8

View File

@@ -49,12 +49,15 @@ public class GainfoFacesController : ControllerBase
var secret = "MLl7Dv7p5Pgc9XYI3r4O";
var headers = InitRequest(url, body, key, secret);
foreach (var item in headers.Where(x => x.Key != "Content-Type"))
var content = new StringContent(body, Encoding.UTF8);
foreach (var item in headers)
{
client.DefaultRequestHeaders.Add(item.Key, item.Value);
content.Headers.Add(item.Key, item.Value);
}
var r = await client.PostAsync(url, new StringContent(body, Encoding.UTF8, "application/json"));
var r = await client.PostAsync(url, content);
return await r.Content.ReadAsStringAsync();
}