net/http.lua

changeset 1111
a1cf1d623695
parent 923
c63f9bc45a85
child 1112
e8a00a2ea910
equal deleted inserted replaced
1110:ececc4162d58 1111:a1cf1d623695
13 tonumber, tostring, pairs, xpcall, select, debug.traceback; 13 tonumber, tostring, pairs, xpcall, select, debug.traceback;
14 14
15 local log = require "util.logger".init("http"); 15 local log = require "util.logger".init("http");
16 local print = function () end 16 local print = function () end
17 17
18 local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });
19 local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end 18 local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end
20 19
21 module "http" 20 module "http"
22 21
23 local function expectbody(reqt, code) 22 local function expectbody(reqt, code)

mercurial