response_header.lua 281 B

1234567891011
  1. body = [[<html><body><p>
  2. Hello world!
  3. </p>
  4. </body></html>
  5. ]]
  6. --mg.response.status = 200 -- "200 OK" is the default
  7. mg.response.http_headers["Content-Type"] = "text/html";
  8. mg.response.http_headers["Content-Length"] = tostring(string.len(body));
  9. mg.response.send();
  10. mg.write(body);