Person myPerson = new Person("Chris", "Pietschmann");
System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(myPerson.GetType());
MemoryStream ms = new MemoryStream();
string json = System.Text.Encoding.UTF8.GetString(ms.ToArray());
Response.ContentType = "application/json;charset=utf-8";
We have seen people asking interview questions on REST after JSON questions. Below is a simple .NET interview question video with answer which talks about what is REST ?.
Also read this interesting ASP.NET interview question with answer on Server.Transfer and Response.Redirect ?