You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Critical. A critical defect that causes some key functionality to fail.
Priority
High. Anything that impacts the typical user flow or blocks app usage.
Description
When I invoke an HTTP API using Skyrim Platform's HttpClient.post, it returns an invalid HttpResponse object in its callback with a status code of 0 and an empty body.
The request reaches the server with the correct information, and the server I tested with correctly responds with a 200 status code and a plain text message, which the client fails to retrieve.
It seems to work as expected on rare occasions, but I've failed to reproduce it reliably so far. HttpClient.get seems to work fine, in comparison.
OS
Linux
OS version
Manjaro/KDE/Wayland
Skyrim version
1.6.1170
SKSE version
2.2.6
client commit''s hash
(Skyrim Platform 2.9.0 Release)
server commit''s hash
N/A
Videocard model
NVidia RTX3080
Steps to reproduce
Here's a snippet of the code that shows the issue:
consthttp=newHttpClient("http://127.0.0.1:3001")constpayload={// some JSON data }
http.post("/api/generate",{contentType: "application/json",body: JSON.stringify(payload)},).then(res=>{// This prints "Status: 0, Error: , Body: " most of the times:printConsole(`Status: ${res.status}, Error: ${res.error}, Body: ${res.body}`)})
Expected result
See the above example.
Actual result
See the above example.
The text was updated successfully, but these errors were encountered:
After a bit more testing, I have a feeling that it might not have to do with post or get but with the timeout. If the server takes too long to respond, the client seems to return prematurely without an error.
I need more tests to confirm this behaviour. But in this case, a configurable timeout option with the promise failing upon exceeding the specified value could be nice.
Pospelove
changed the title
[Bug]: HttpClient.post returns an invalid HttpResponse
Document HttpClient behavior in case of timeout (zero status code and empty body)
Dec 11, 2024
Severity
Critical. A critical defect that causes some key functionality to fail.
Priority
High. Anything that impacts the typical user flow or blocks app usage.
Description
When I invoke an HTTP API using Skyrim Platform's
HttpClient.post
, it returns an invalidHttpResponse
object in its callback with astatus
code of0
and an emptybody
.The request reaches the server with the correct information, and the server I tested with correctly responds with a 200 status code and a plain text message, which the client fails to retrieve.
It seems to work as expected on rare occasions, but I've failed to reproduce it reliably so far.
HttpClient.get
seems to work fine, in comparison.OS
Linux
OS version
Manjaro/KDE/Wayland
Skyrim version
1.6.1170
SKSE version
2.2.6
client commit''s hash
(Skyrim Platform 2.9.0 Release)
server commit''s hash
N/A
Videocard model
NVidia RTX3080
Steps to reproduce
Here's a snippet of the code that shows the issue:
Expected result
See the above example.
Actual result
See the above example.
The text was updated successfully, but these errors were encountered: