jiezaizone commented on issue #2053:
URL: https://github.com/apache/apisix/issues/2053#issuecomment-673288228


   发自我的华为手机-------- 原始邮件 --------发件人: yfgcq <notificati...@github.com>日期: 
2020年8月13日周四 下午2:21收件人: apache/apisix <api...@noreply.github.com>抄送: Subscribed 
<subscri...@noreply.github.com>主    题: [apache/apisix] request help: how to get 
post data of form-data、x-www-form-urlencoded、data-raw(json) (#2053)
   Issue description
   how to get post data of form-data、x-www-form-urlencoded、data-raw(json)?
   怎么获取这几种form-data、x-www-form-urlencoded、data-raw(json) post请求的post data ?
   ngx.req.get_post_args()可以获取 x-www-form-urlencoded请求的post data
   ngx.req.get_body_data()可以获取data-raw(json) ,必须指定ContentType:application/json,
   但是有时postman 或者curl 请求时 没指定ContentType
   curl xxx POST -i -d ' {"AppKey": "a1", "id": 22234666}'
   apisix 判断逻辑:
   if string.find(ngx.req.get_headers()["Content-Type"] or 
"","application/json", 1, true) then ngx.req.get_body_data() else 
ngx.req.get_post_args() -- end
   问题1:这种情况怎么办?
   问题2:form-data 不知道怎么获取?
   Environment
   apisix version (cmd: apisix version):1.4.1OS:linux
   
   —You are receiving this because you are subscribed to this thread.Reply to 
this email directly, view it on GitHub, or unsubscribe.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to