mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Add HTTPS Lua module.
It can be loaded via https = require("https").
Basic API is responsecode, body = https.request(url).
Slightly more advanced API is responsecode, body, headers = https.request(url, {method="post" or "get", data=str, headers={}}).
This commit is contained in:
@@ -173,6 +173,10 @@ extern "C"
|
||||
extern int luaopen_love_arg(lua_State*);
|
||||
extern int luaopen_love_callbacks(lua_State*);
|
||||
extern int luaopen_love_boot(lua_State*);
|
||||
|
||||
#ifdef LOVE_ENABLE_LUAHTTPS
|
||||
extern int luaopen_https(lua_State*);
|
||||
#endif
|
||||
}
|
||||
|
||||
static const luaL_Reg modules[] = {
|
||||
@@ -656,6 +660,9 @@ int luaopen_love(lua_State *L)
|
||||
#ifdef LOVE_ENABLE_LUA53
|
||||
love::luax_preload(L, luaopen_luautf8, "utf8");
|
||||
#endif
|
||||
#ifdef LOVE_ENABLE_LUAHTTPS
|
||||
love::luax_preload(L, luaopen_https, "https");
|
||||
#endif
|
||||
|
||||
#ifdef LOVE_ENABLE_WINDOW
|
||||
// In some environments, LuaJIT is limited to 2GB and LuaJIT sometimes panic when it
|
||||
|
||||
Reference in New Issue
Block a user