It looks like you're new here. If you want to get involved, click one of these buttons!
local query = "key1=value1&key2=value2" local response = {} local res, code, headers, status = http.request { method = "POST", url = "<a href="https://yourwebsite.com/"" rel="nofollow">https://yourwebsite.com/"</a>, source = ltn12.source.string(query), headers = { ["Accept"] = "*/*", ["Accept-Encoding"] = "gzip, deflate", ["Accept-Language"] = "en-us", ["Content-Type"] = "application/x-www-form-urlencoded", ["content-length"] = string.len(query) }, sink = ltn12.sink.table(response) } print('body:' .. table.concat(response)) print('code:' .. tostring(code)) print('headers:' .. table.concat(headers)) print('status:' .. tostring(status))
body:1 code:200 headers: "set-cookie": "config_version=887; expires=Sat, 29-Jun-2013 19:07:09 GMT; Max-Age=86400; Path=/" "date": "Fri, 28 Jun 2013 19:07:09 GMT" "ed-config-version": "887" "content-encoding": "gzip" "cache-control": "private, no-cache, no-store, must-revalidate" "connection": "Close" "vary": "Cookie" "content-length": "52" "pragma": "no-cache" "content-type": "application/json; charset=utf-8" "server": "nginx/1.2.7" status:HTTP/1.1 200 OK
Likes: duke2017
Comments
Likes: duke2017