{"id":486,"date":"2021-08-22T18:00:19","date_gmt":"2021-08-22T09:00:19","guid":{"rendered":"https:\/\/mvc.auctionpro.co.kr\/?page_id=486"},"modified":"2021-08-22T18:02:51","modified_gmt":"2021-08-22T09:02:51","slug":"website-php-%eb%98%90%eb%8a%94-webservice-get-post-%ec%82%ac%ec%9a%a9","status":"publish","type":"page","link":"https:\/\/mvc.auctionpro.co.kr\/?page_id=486","title":{"rendered":"Website Php \ub610\ub294 webService Get\/Post \uc0ac\uc6a9"},"content":{"rendered":"\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">1. Get <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \">using System.Net; \/\/add\n\nstring username = \"john\";\nstring urlAddress = \"http:\/\/www.yoursite.tld\/somepage.php?username=\" + username;  \n\nusing (WebClient client = new WebClient())\n{\n       \/\/ this string contains the webpage's source\n       string pagesource = client.DownloadString(urlAddress);  \n}<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. Post<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \" >using System.Collections.Specialized; \/\/add\n\n\nstring username = \"john\";\nstring referer = \"myprogram\";\nstring urlAddress = \"http:\/\/www.yoursite.tld\/somepage.php\";\n\nusing (WebClient client = new WebClient())\n\n\nusing System.Net; \/\/add\nusing System.Collections.Specialized; \/add\n\n{\n       NameValueCollection postData = new NameValueCollection() \n       { \n              { \"username\", username },  \/\/order: {\"parameter name\", \"parameter value\"}\n              { \"referer\", referer }\n       };\n\n       \/\/ client.UploadValues returns page's source as byte array (byte[])\n       \/\/ so it must be transformed into a string\n       string pagesource = Encoding.UTF8.GetString(client.UploadValues(urlAddress, postData));\n}<\/pre><\/div>\n\n\n\n<p>\ucc38\uc870 : https:\/\/codingvision.net\/c-sending-data-using-get-or-post<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Get 2. Post \ucc38\uc870 : https:\/\/codingvision.net\/c-sending-data-using-get-or-post<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-486","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=486"}],"version-history":[{"count":2,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/486\/revisions"}],"predecessor-version":[{"id":489,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/486\/revisions\/489"}],"wp:attachment":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}