http with method post
Hello, i try this code bellow in a button
let response := http("POST", "http://localhost/test.php", {
myParameter: "myParameterValue"
}, {
'Content-Type': "application/json"
});
if response.error then
alert("ERREUR:" + text(response.error))
else
alert("RESULT:" + text(response.result))
end
In the test.php i dont can retrive the parameter : myParameter
i try many thing, like : file_get_contents('php://input'); but i dont can retrieve the parameter.
But i know the request is sending good way to php file, because un simple echo in php is fired.
Any help?
Thanks
Robert
4 replies
-
nobody use http with post method?
-
a little help inside php for retrieve paramters sending with http() function and post method.
-
Hi Robert,
we are having an API workshop on monday:
https://zoom.us/webinar/register/WN_tNnu2wwPSHWtwZQvj3egFw
Would you like to join?
Best, Alex
-
Hello,
we also have the same problem: http POST - but parameters are not sent to the backend.
let oauth := do as server
http("POST", "https://api.digikey.com/v1/oauth2/token“, {'client_id': „xyz“ } )
end;
let oauth := do as server
http("POST", "https://api.digikey.com/v1/oauth2/token“, { ‘content-type’:“application/json“}, {'client_id': „xyz“ } )
end;
let oauth := do as server
http("POST", "https://api.digikey.com/v1/oauth2/token“, {'client_id': „xyz“ }, { ‘content-type’:“application/json“} )
end;digikey returns always: "client_id" is undefined or null
Thanks
Achim
Content aside
- 3 yrs agoLast active
- 4Replies
- 2127Views