C# 초간단 WebRequest 예제
꽁스짱
C#
0
1268
2021.05.31 22:58
using System;
using System.Net;
using System.IO;
class Test
{
static void Main(string[] args)
{
request.Method = "GET";
WebResponse response = request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer); // response 출력
reader.Close();
dataStream.Close();
response.Close();
}
}