ES3Cloud.AddPOSTField
Description
Adds POST data to any requests sent by this ES3Cloud object.
This is useful if you are customising the ES3.php file, or are sending a request to a custom script.
Parameters
fieldName | The name of the field we want to add to the POST data. |
value |
The value of the POST data we want to add. |
Examples
C#
1 2 3 4 5 6 7 8 9 10 11 |
// Create a new ES3Cloud object with the URL to our custom ES3.php file. var es3Cloud = new ES3Cloud("https://www.myserver.com/CustomES3.php", "myAPIKey"); // Add the scene name to our POST data so we can use this in our custom PHP script. es3cloud.AddPOSTField("scene", SceneManager.GetActiveScene().name); // Upload a file, and our scene POST field will also be received by the PHP script. yield return StartCoroutine(cloud.UploadFile("myFile.es3", "myUser", "myUsersPassword")); if(cloud.isError) Debug.LogError(cloud.error); |
JS
1 2 3 4 5 6 7 8 9 10 11 |
// Create a new ES3Cloud object with the URL to our custom ES3.php file. var es3Cloud = new ES3Cloud("https://www.myserver.com/CustomES3.php", "myAPIKey"); // Add the scene name to our POST data so we can use this in our custom PHP script. es3cloud.AddPOSTField("scene", SceneManager.GetActiveScene().name); // Upload a file, and our scene POST field will also be received by the PHP script. yield cloud.UploadFile("myFile.es3", "myUser", "myUsersPassword"); if(cloud.isError) Debug.LogError(cloud.error); |