lua post请求

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)
    A+
发布日期:2017年12月26日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: