//request formation with URL
httpRequest = System.Net.WebRequest.Create(new Uri(Url)) as System.Net.HttpWebRequest;
httpRequest.Method = "POST";
httpRequest.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
httpRequest.ContentType = "application/json";//application type
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
//request Paramets
string Params = new JavaScriptSerializer().Serialize(objJioFetchWalletREQUEST);
byte[] data = encoding.GetBytes(Params);
httpRequest.ContentLength = data.Length;
try
{
//sending request to URL
using (System.IO.Stream newStream = httpRequest.GetRequestStream())
{
newStream.Write(data, 0, data.Length);
}
//response from URL
httpResponse = httpRequest.GetResponse() as System.Net.HttpWebResponse;
using (System.IO.Stream resStream = httpResponse.GetResponseStream())
{
System.IO.StreamReader reader = new System.IO.StreamReader(resStream);
responseData = reader.ReadToEnd();
}
httpRequest = System.Net.WebRequest.Create(new Uri(Url)) as System.Net.HttpWebRequest;
httpRequest.Method = "POST";
httpRequest.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
httpRequest.ContentType = "application/json";//application type
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
//request Paramets
string Params = new JavaScriptSerializer().Serialize(objJioFetchWalletREQUEST);
httpRequest.ContentLength = data.Length;
try
{
//sending request to URL
using (System.IO.Stream newStream = httpRequest.GetRequestStream())
{
newStream.Write(data, 0, data.Length);
}
//response from URL
httpResponse = httpRequest.GetResponse() as System.Net.HttpWebResponse;
using (System.IO.Stream resStream = httpResponse.GetResponseStream())
{
System.IO.StreamReader reader = new System.IO.StreamReader(resStream);
responseData = reader.ReadToEnd();
}