I cannot pass value properly. This code executed successfully but the null value reached to the specified page("http://.............).
Product objProduct = new Product();
objProduct.id = "1";
objProduct.name = "Sana";
string json = JsonConvert.SerializeObject(objProduct);
var baseAddress = "http://..................";
var http = (HttpWebRequest)WebRequest.Create(new Uri(baseAddress));
http.Accept = "application/json";
http.ContentType = "application/json";
http.Method = "POST";
string parsedContent = json;
ASCIIEncoding encoding = new ASCIIEncoding();
Byte[] bytes = encoding.GetBytes(parsedContent);
Stream newStream = http.GetRequestStream();
newStream.Write(bytes, 0, bytes.Length);
newStream.Close();
var response = http.GetResponse();
var stream = response.GetResponseStream();
var sr = new StreamReader(stream);
var content = sr.ReadToEnd();