I am handling post request data in PHP:
header(\"Access-Control-Allow-Origin: *\");
header(\"Content-Type: application/json; charset=UTF-8\");
header(\"Access-Co
For everyone who comes to this question:
From conversation we had. unity
sends request as urlencoded
. The UnityWebRequest.Post send urlencoded data:
uri
The target URI to which form data will be transmitted.
postData
Form body data. Will be URLEncoded prior to transmission.
to decode data in PHP
.
$request = file_get_contents("php://input");
$decoded = urldecode($request);
to parse json to object:
$data = json_decode($decoded);
to get attribute of json.
$data->{attribute};