http.post request with ?key=value&key=value after adress
Posted: Sun Sep 17, 2017 5:17 am
I have a problem with doing by myself a http.post() request. I want to perform API requests on NodeMCU based on ESP8266 with Lua language. The first problem that i met was "Plain HTTP on HTTPS adress". For now it says "bad token", so, it means that he didn't receive my post parameters.
How it need to be correct?
Usually i use GMod Lua for making requests. Code there will be easy:
http.Post on GMod Lua Wiki
How it need to be correct?
Code: Select all
http.post("http://www.2level.1level/api.php","Content-Type: text/plain","token=mytokenhere&arg1=argumentforrequest",
function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
end)
Usually i use GMod Lua for making requests. Code there will be easy:
Code: Select all
http.Post("https://www.2level.1level/api.php",{token=mytokenhere,arg1=argumentforrequest},function(txt) end,function(txt) end)
http.Post on GMod Lua Wiki