C#에서 호출
C# 에서 POST 방식으로 웹페이지 호출하는 방법입니다.
NameValueCollection POST = new NameValueCollection(); POST.Add("cmd", "mycommand"); WebClient web = new WebClient(); string URL = "http://whiteat.com/home/command.php"; return Encoding.UTF8.GetString(web.UploadValues(URL, "POST", POST));
웹페이지에서 처리
$cmd = $_POST['cmd']; echo "command is ".$cmd; // output command is mycommand