Merge pull request #63 from Qtoss-AI/jason_dev

Jason dev
This commit is contained in:
Haiping 2024-12-30 14:20:53 +00:00 committed by GitHub
commit f9b10496ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,17 +150,20 @@ public class PlaywrightInstance : IDisposable
ResponseInMemory = args.ResponseInMemory
};
var html = await response.TextAsync();
if (response.Headers["content-type"].Contains("application/json"))
{
if (response.Status == 200 && response.Ok)
{
var json = await response.JsonAsync();
result.ResponseData = JsonSerializer.Serialize(json);
{
if (!string.IsNullOrWhiteSpace(html))
{
var json = await response.JsonAsync();
result.ResponseData = JsonSerializer.Serialize(json);
}
}
}
else
{
var html = await response.TextAsync();
result.ResponseData = html;
}