LuaMinXmlHttpRequest如何post

比如一个http协议,需要post一个uid给服务端来请求数据,该怎么实现?协议返回时json;
Test-lua里面的例子是没有post内容的:

local xhr = cc.XMLHttpRequest:new()
xhr.responseType = cc.XMLHTTPREQUEST_RESPONSE_JSON
xhr:open(“POST”, “http://httpbin.org/post”)

local function onReadyStateChange()
labelStatusCode:setString(“Http Status Code:”…xhr.statusText)
local response = xhr.response
local output = json.decode(response,1)
table.foreach(output,function(i, v) print (i, v) end)
print(“headers are”)
table.foreach(output.headers,print)
end

xhr:registerScriptHandler(onReadyStateChange)
xhr:send()

有人使用过吗,麻烦分享下。

这个post 有问题呀,

将参数放到字符串内,用&连接。然后send方法中传入这个参数
local content = “a=111&b=123”
xhr:send(content)