HTTP Library parity to experimental-event branch

This commit is contained in:
Alessandro Proto 2023-01-09 23:03:02 +01:00
parent a0c3155f8c
commit 2e4d73e608

View file

@ -155,10 +155,7 @@ public class HTTP : IPlugin
else
content = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
_game.LuaRuntime.PushEvent("http_response", requestId, content, (int)response.StatusCode);
else
_game.LuaRuntime.PushEvent("http_failure", requestId, content, (int)response.StatusCode, response.ReasonPhrase);
_game.LuaRuntime.PushEvent("http_response", requestId, response.IsSuccessStatusCode, content, (int)response.StatusCode, response.ReasonPhrase);
});
L.PushInteger(requestId);