local json = require("cjson")
local red = require("a2.libs.redis_pool")
local conf = require("a2.libs.config")
local my = require("a2.libs.my_pool")
local http = require("resty.http")
local args = ngx.req.get_uri_args()
local data = {}
data["Status"] = 0
data["Desc"] = "OK"
local request_method = ngx.var.request_method
local args = nil
local body_data=nil
if "GET" == request_method then
data["Status"] = 1
data["Desc"] = "request_method error"
ngx.say(json.encode(data))
return
elseif "POST" == request_method then
ngx.req.read_body()
body_data = ngx.req.get_body_data()
end
ngx.log(ngx.ERR, "====================body_data============================: "..body_data)
data["data"] = body_data
json.encode_empty_table_as_object(false)
ngx.say(json.encode(data))
以上就是代码,只用来测试无实际用途。 获取到的body_data是不完全的,谁能帮忙说明下是哪的问题呢。
OC端自己发送之前打印出的数据是没问题的,通过http发送过来,数据就不完整了,数据量也不是很大,也就几k。