annotate src/tools/request.txt.luan @ 38:19269d18b949

sceditor work
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 05 Aug 2022 00:04:58 -0600
parents 2f20b11affdd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Binary = require "luan:Binary.luan"
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local Io = require "luan:Io.luan"
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local Http = require "luan:http/Http.luan"
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 return function()
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 Io.stdout = Http.response.text_writer()
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 %><%= Http.request.raw_head %><%
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 if Http.request.body ~= nil then
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 %><%=Binary.to_string(Http.request.body,"utf-8")%><%
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 end
2f20b11affdd add tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 end