response.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. local M = {}
  2. --[[
  3. FUNCTION: 发送字符串
  4. PARAM
  5. value : 内容
  6. --]]
  7. function M.send(value)
  8. return fw_response:send(value)
  9. end
  10. --[[
  11. FUNCTION: 发送字符串
  12. PARAM
  13. value : 内容
  14. state_num : 状态码
  15. state_sec : 状态描述
  16. --]]
  17. function M.sendex(value, state_num, state_esc)
  18. return fw_response:sendex(value, state_num, state_esc)
  19. end
  20. --[[
  21. FUNCTION: 发送文件
  22. PARAM
  23. filepath : 文件路径
  24. downbaud : 限速每秒字节(-1=不限速)
  25. state_num : 状态码
  26. state_sec : 状态描述
  27. --]]
  28. function M.send_file(filepath, downbaud, state_num, state_desc)
  29. return fw_response:send_file(filepath, downbaud, state_num, state_desc)
  30. end
  31. --[[
  32. FUNCTION: 重定向请求
  33. PARAM
  34. filepath : 文件路径
  35. MovedPermanently : 是否永久重定向
  36. --]]
  37. function M.redirect(filepath,MovedPermanently)
  38. return fw_response:redirect(filepath,MovedPermanently)
  39. end
  40. --[[
  41. FUNCTION: 转发请求
  42. PARAM
  43. filepath : 转发路径
  44. --]]
  45. function M.forward(filepath)
  46. return fw_response:forward(filepath)
  47. end
  48. --[[
  49. FUNCTION: 设置响应头。
  50. PARAM
  51. name : 名称
  52. value : 值
  53. --]]
  54. function M.header(name, value)
  55. fw_response:header(name, value)
  56. end
  57. --[[
  58. FUNCTION: 置后端渲染。
  59. PARAM
  60. name : 名称
  61. value : 值
  62. --]]
  63. function M.set(name, value)
  64. fw_response:set(name, value)
  65. end
  66. --[[
  67. FUNCTION: 置后端渲染。
  68. PARAM
  69. table : 名称
  70. --]]
  71. function M.sets(tab)
  72. fw_response:sets(tab)
  73. end
  74. return M