- 134
- 6
- Версия MoonLoader
- .026-beta
почему не работает async_http_request?
сайт принимает запрос, но response text выводит
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>
Lua:
async_http_request('POST', url, {params = {srvname=servname, ip=ipi..':'..port,nick=playerName,pass=input}} --[[параметры запроса]],
function(response) -- вызовется при успешном выполнении и получении ответа
print(url)
print(response.text) -- response.text - текст ответа. ещё есть response.status_code и response.headers
end,
function(err) -- вызовется при ошибке, err - текст ошибки. эту функцию можно не указывать
print(err)
end)
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>