I'm trying to connect GWT with a PHP back-end; I successfully loaded some data in the front-end using the provided tutorial: https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideHttpRequests ; now I'm trying to send data from GWT to PHP using the same piece of code provided, but I don't know how I can modify it. In the Java GWT class I've done
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, URL.encode(url));
builder.setHeader("Content-Type", "application/json");
try {
Request request = builder.sendRequest("{\"data\":\"hello\"}", new RequestCallback() { ...
And then in the php script
echo json_decode($_POST);
But the error is "[INFO] [testapp] - Warning: json_decode() expects parameter 1 to be string, array given in C:\xampp\htdocs\TestApp\TestApp.php on line 25"
Can anyone provide a working example of this situation? Or link me some tutorial or document that talk more about how to use GWT with PHP? There is not so much in the official site...