I’m trying to create a POST request following the documentationthis is what i have so far:
local headers = {} local params = {} local function networkListener(event) if(event.isError) then print("Network Error!") else print("Reponse: "..event.response) end end headers["Content-Type"] = "application/x-www-form-urlencoded" --headers["Accept-Language"] = "en-US" local body = "color=red&size=small" params.headers = headers params.body = body local function enviarErro(event) -- SUBMIT BUTTON native.setKeyboardFocus(nil) print("Enviar erro criar url aqui "..textoEnvio) network.request( "http://perpetualmotionstudio.com/quizverdao/senderror.php", "POST", networkListener,params ) end
For some reason i always getting a empty response, but by using POSTMAN(Chrome extension), i see that everything is just working, and the problem is that my network.request is not sending the params.
this is what i have in senderror.php
\<?php echo($\_POST["color"]); echo($\_POST["size"]); ?\>
Thanks!