using System;
using System.Net;
using System.IO;

namespace NetKingdom
{
    class Program    
    {
        static WebRequest request;
        static WebResponse response;
        static Stream dataStream;
        static StreamReader reader;

        static void Main(string[] args)
        {
            request = WebRequest.Create("https://news.naver.com");//URL ADDRESS
            request.Method = "GET";
                
            response = request.GetResponse();
            dataStream = response.GetResponseStream();
            reader = new StreamReader(dataStream);
 
            string responseFromServer = reader.ReadToEnd();
 
            Console.WriteLine(responseFromServer); // response 출력
 
            reader.Close();
            dataStream.Close();
            response.Close();
        }
    }
}

+ Recent posts