I have a little problem with sending JSON data to a PHP file.
I am using XE10 (update 1) with Indy 10.6.2.
iDHTTP contenttype is application/json
Contentencoding is utf-8
I have a variable JS with correct JSON data.
I have a variable AD with valid adres to the PHP file.
If I put the output of AD + JS in the browser my PHP file is doing what it should do, i.e. creating a file with the JSON values.
But, when I do idHTTP.GET(AD + JS);
, the PHP file creates an empty file.
So the PHP scipt gets called but without the JSON data.
Can someone help me PLEASE, why the data is not sending.
BTW Can I use the GET method (If not then how can I do this)?
Here is the code:
Procedure Twebform.NaPost(k : TJSONObject );
var
str : WideString;
begin
str := 'http://www.mywebsite.com/test.php?value='+k.ToString;
try
IdHTTPJ.GET(str);
except on E:Exception do
begin
ShowMessage(E.Message);
end;
end;
end;