开发者

LuaSockets POST data issue [LUA]

I'm getting GET data without issue using:

      local get, err = client:receive()
开发者_JS百科

But I'm not sure how to receive POST data. I've tried:

      local get, err = client:receive('*a')

But the server seems to always timeout on POST data (the test data is just an textbox with some words in it)

Any help fully appreciated and as always please link me if this is a repeat question!

Cheers!


I've managed to find a solution to my problem, seems that the:

local get, err = client:receive('*a')

method only returns complete data. Headers seem to fall under partially received rather than fully received and as such gets placed to a third variable:

local data, emsg, partial = client:receive(pattern, prefix)

This seems to be undocumented, but I may just have missed it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜