Url : https://sampleurl.com/api1/token
string sURL = "https://sampleurl.com/api1/token/Actualusername/Actualpassword"; WebRequest wrGETURL; wrGETURL = WebRequest.Create(sURL); wrGETURL.Method = "POST"; wrGETURL.ContentType = @"application/json; charset=utf-8"; wrGETURL.ContentLength = 0; HttpWebResponse webresponse = wrGETURL.GetResponse() as HttpWebResponse; Encoding enc = System.Text.Encoding.GetEncoding("utf-8"); // read response stream from response object StreamReader loResponseStream = new StreamReader(webresponse.GetResponseStream(), enc); // read string from stream data string strResult = loResponseStream.ReadToEnd(); // close the stream object loResponseStream.Close(); // close the response object webresponse.Close(); Response.Write(strResult);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)