JSONObject.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
	public override string ToString()
	{
		return Print();
	}
	public string ToString(bool pretty)

Same methods

JSONObject::ToString ( bool pretty ) : string

Usage Example

Example #1
0
    IEnumerator PostData(JSONObject json)
    {
        //WWWForm testWWW = new WWWForm();
        //testWWW.AddField("Score","12");
        //testWWW.AddField("ContentKey","91FA1062-255B-40FB-A108-3FA783BFF6CD");
        //testWWW.AddField("Level","31");
        //testWWW.AddField("User","0980808A-2AFC-411D-96A5-009487091A61");
        //testWWW.AddField("Date","2014-06-06 00,00,00Z");
        //testWWW.AddField("Powerbar","21");
        //WWW www = new WWW(url, testWWW);

        //string input = @"{""Date"":""" + System.DateTime.Now.ToString("mm/dd/yyyyTHH:mm:ss") +@"""}";
        Hashtable headers = new Hashtable();
        headers.Add("Content-Type", "application/json");

        print("Exact Json: \n" + json.ToString(true));
        byte[] body = System.Text.Encoding.UTF8.GetBytes(json.ToString());
        WWW www = new WWW(url, body, headers);
        
        yield return www;
        if (www.error != null)
        {
            print("Platform posting - SUCCESS");
        }
    }
All Usage Examples Of JSONObject::ToString