0

我正在使用以下方法毫无问题地获取 GET 数据:

      local get, err = client:receive()

但我不确定如何接收 POST 数据。我试过了:

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

但是服务器似乎总是在 POST 数据上超时(测试数据只是一个包含一些单词的文本框)

任何帮助都非常感谢,如果这是一个重复的问题,请一如既往地联系我!

干杯!

4

1 回答 1

1

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

于 2011-07-26T08:33:41.630 回答