|
Download Luar/moonloader/lib/doc/modules/http.compat.socket.md from andy-gg/LUAR_RP_PC: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/datasets/andy-gg/LUAR_RP_PC/resolve/main/Luar/moonloader/lib/doc/modules/http.compat.socket.md
- Command line
-
hf download hf://datasets/andy-gg/LUAR_RP_PC/Luar/moonloader/lib/doc/modules/http.compat.socket.md
-
curl -L -o http.compat.socket.md https://huggingface.co/datasets/andy-gg/LUAR_RP_PC/resolve/main/Luar/moonloader/lib/doc/modules/http.compat.socket.md
566 Bytes
http.compat.socket
Provides compatibility with luasocket's http.request module.
Differences:
- Will automatically be non-blocking when run inside a cqueues managed coroutine
- lua-http features (such as HTTP2) will be used where possible
Example {#http.compat.socket-example}
Using the 'simple' interface as part of a normal script:
local socket_http = require "http.compat.socket"
local body, code = assert(socket_http.request("http://lua.org"))
print(code, #body) --> 200, 2514