ES3Cloud.AddPOSTField

public static void AddPOSTField(string fieldName, string value)

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

[table th=”0″]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.”[/table]

Examples

C#

// 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

// 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);