lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 24.10.2011 17:33, Peng Zhicheng wrote:

I'm trying to send a web form to a server with Lua Socket but I did
not find any example. I found only your post in Lua list. Did you
resolve your problem? Can you send me an example of how I can send a
HTTP POST with parameters (variables)?

    local rq_resp = {}
    local b,c,h = http.request {
      method = "POST",
      url = my_url,
      headers = {},
      source = ltn12.source.string(rq_body),
      sink = ltn12.sink.table(rq_resp),
    }

cf. http://w3.impa.br/~diego/software/luasocket/http.html#request