comparison src/luan/modules/http/tools/Dump_mod.luan @ 1160:4beabb087be6

add http/impl
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 05 Feb 2018 22:33:59 -0700
parents 0842b9b570f8
children 668f29bc52ea
comparison
equal deleted inserted replaced
1159:3ef883468fd0 1160:4beabb087be6
11 function Dump_mod.respond() 11 function Dump_mod.respond()
12 Http.response.headers["content-type"] = "text/plain" 12 Http.response.headers["content-type"] = "text/plain"
13 Io.stdout = Http.response.text_writer() 13 Io.stdout = Http.response.text_writer()
14 14
15 local method = Http.request.method 15 local method = Http.request.method
16 local path = Http.request.path 16 local path = Http.request.full_path()
17 local query = Http.request.query_string()
18 if method ~= "POST" and query ~= nil then
19 path = path.."?"..query
20 end
21 %> 17 %>
22 <%=method%> <%=path%> <%=Http.request.protocol%> 18 <%=method%> <%=path%> <%=Http.request.protocol%>
23 <% 19 <%
24 Dump_mod.dump_headers(Http.request.headers) 20 Dump_mod.dump_headers(Http.request.headers)
25 %> 21 %>
26 22
27 <% 23 <%
28 if method == "POST" and query ~= nil then 24 if method == "POST" then
29 %> 25 %>
30 <%=query%> 26 <%=Io.repr(Http.request.parameters)%>
31 <% 27 <%
32 end 28 end
33 end 29 end
34 30
35 31