C# - Read JSON

I need to read a JSON that is printed in a php file hosted online.

I’m doing this:

using(WebClient wb = new WebClient()){

     var data = new NameValueCollection();

     data["email"] = emailUser;

     data["idFB"] = id;

     var response = wb.UploadValues(url.ToString(), "POST", data);

     yield return response;
}

How can I read a json after doing this in C#?

Include(or develop your own) a Json library for parsing the Json for consumption by your program. The Unify Community has posted SimpleJson for free for you to use.

You can find SimpleJson here. There are also instructions for inclusion in your project on that same wiki entry.

Edit: You may want to use Unity’s WWWForm(to post) class instead of .net’s WebRequest

Edit 2: Something like:

WWWForm form = new WWWForm();

form.AddField("email", emailUser);
form.AddField("idFB", id);

WWW webRequest = new WWW(url.ToString(), form);

yield webRequest;

You will find your json in webRequest.text, parse that.