1. using UnityEngine;
    2. using System.Collections;
    3. public class MyBehavior : MonoBehaviour {
    4. StartCoroutine(Upload());
    5. }
    6. IEnumerator Upload() {
    7. byte[] myData = System.Text.Encoding.UTF8.GetBytes("This is some test data");
    8. yield return www.SendWebRequest();
    9. if(www.isNetworkError || www.isHttpError) {
    10. Debug.Log(www.error);
    11. }
    12. else {
    13. Debug.Log("Upload complete!");
    14. }
    15. }