Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebRequest req = WebRequest.Create(@"https://api.tookanapp.com");
- req.Method = "GET";
- HttpWebResponse resp = req.GetResponse() as HttpWebResponse;
- if (resp.StatusCode == HttpStatusCode.OK)
- {
- using (Stream respStream = resp.GetResponseStream())
- {
- StreamReader reader = new StreamReader(respStream, Encoding.UTF8);
- Console.WriteLine(reader.ReadToEnd());
- }
- }
- else
- {
- Console.WriteLine(string.Format("Status Code: {0}, Status Description: {1}", resp.StatusCode, resp.StatusDescription));
- }
- Console.Read();
Add Comment
Please, Sign In to add comment