lua post请求

发布时间:2017-12-26 09:49:23 阅读:1549次

http://bbs.chinaunix.net/thread-4095178-1-1.html

  1. local request_method = ngx.var.request_method
  2. local args = nil
  3. local param = nil
  4. local param2 = nil


  5. --获取参数的值
  6. if "GET" == request_method then
  7.     nginx.say("get")
  8.     args = ngx.req.get_uri_args()
  9. elseif "POST" == request_method then
  10.     ngx.req.read_body()
  11.     args = ngx.req.get_post_args()
  12. end

  13. param = args["param"]
  14. param2 = args["param2"]
  15. ngx.say(param)

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
上一篇:香蕉派使用
下一篇:ngx_lua 随笔

转载请注明:lua post请求 出自老鄢博客 | 欢迎分享