Monday, 29 August 2016


Send Data to another server by HttpWebRequest and HttpWebResponse Web API



HttpWebRequest httpreq = (HttpWebRequest)WebRequest.Create(url);
         
            try
            {
                HttpWebResponse httpres = (HttpWebResponse)httpreq.GetResponse();
                StreamReader sr = new StreamReader(httpres.GetResponseStream());
                string results = sr.ReadToEnd();
                sr.Close();
                return results;
            }
            catch
            {
                return "0";
            }

No comments :