Hi
I’m trying to send the json data to server and my line of code is :
JSONObject j = new JSONObject(JSONObject.Type.OBJECT);
for(int i=0;i<Contacts.ContactsList.Count;i++)
{
if(Contacts.ContactsList*.Phones.Count>0)*
-
{* -
JSONObject contactList = new JSONObject(JSONObject.Type.ARRAY);* -
JSONObject phoneNumber = new JSONObject(JSONObject.Type.ARRAY);* -
j.AddField("Contacts",contactList);*
contactList.AddField(“Name”,Contacts.ContactsList_.FirstName+“”+Contacts.ContactsList*.LastName);
contactList.AddField(“PhoneNumber”,phoneNumber);
for(int k=0;k< Contacts.ContactsList[k].Phones.Count;k++)
{
phoneNumber.Add(Contacts.ContactsList.Phones[k]);
}*_
* string jsonData = j.Print();*
* Dictionary<string, string> header = new Dictionary<string,string>();*
* header.Add(“Content-Type”,“application/json”);*
* byte[] body = System.Text.Encoding.UTF8.GetBytes(jsonData);*
* WWW www = new WWW(URL,body,header);*
* StartCoroutine(PostDataEnumerator(www)); *
* }*
* }*
The problem is I don’t know what it do .
Can anyone help me with it to know what does it do and in which form of data the server recieve.
thanks