How to pass Json array to WWWform as field in unity How to pass Json array to WWWform as field in unity json json

How to pass Json array to WWWform as field in unity


Try using WWW instead of WWWForm

    using UnityEngine;    using UnityEngine.UI;    using System.Collections;    using System.Collections.Generic;    public class SendData : MonoBehaviour {     void Start()     {         gameObject.GetComponent<Button>().onClick.AddListener(SendOnClick);     }     IEnumerator WaitForWWW(WWW www)     {         yield return www;         string txt = "";         if (string.IsNullOrEmpty(www.error))             txt = www.text;  //text of success         else             txt = www.error;  //error         GameObject.Find("TextDemo").GetComponent<Text>().text =  "--------\n\n" + txt;     }     void SendOnClick()     {         try         {             GameObject.Find("TextDemo").GetComponent<Text>().text = "Starting..";                string ourPostData = "{\"MarksA\":\"23\",\"MarksB\":\"65\" },{\"MarksA\":\"24\",\"MarksB\":\"56\" }";             Dictionary<string,string> headers = new Dictionary<string, string>();             headers.Add("Content-Type", "application/json");             byte[] jData = System.Text.Encoding.ASCII.GetBytes(ourPostData.ToCharArray());             WWW api = new WWW("YOUR URL", jData, headers);             StartCoroutine(WaitForWWW(api));         }         catch (UnityException ex) { Debug.Log(ex.message); }     }    }