Skip to content

cant get post data #431

@corn1ng

Description

@corn1ng

sorry i use openresty to create a api gateway. meet probelm.
my openresty version is openresty/1.13.6.2 and use MacOS
my code fragment is here .

content_by_lua_block{
      ngx.req.read_body()
      local args, err = ngx.req.get_uri_args()
      local http = require "resty.http"
      local json = require "resty.json"
      local request_method = ngx.var.request_method
      local headers = ngx.req.get_headers()
      local cookie = headers.cookie
      local body = {
          url = ngx.var.uri,
          query = ngx.req.get_uri_args(),
          type = request_method,
          post = ngx.req.get_post_args()
      }
      ngx.log(ngx.ERR,PrintTable(body['post']))
}

my code is here
when i use postman send a post request
image

the body['post'] is null not have value.

the log is here
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions