{"id":484,"date":"2021-08-22T17:57:30","date_gmt":"2021-08-22T08:57:30","guid":{"rendered":"https:\/\/mvc.auctionpro.co.kr\/?p=484"},"modified":"2021-08-22T17:57:32","modified_gmt":"2021-08-22T08:57:32","slug":"php-website-%eb%98%90%eb%8a%94-webservice-get-%ed%98%b8%ec%b6%9c","status":"publish","type":"post","link":"https:\/\/mvc.auctionpro.co.kr\/?p=484","title":{"rendered":"php WebSite \ub610\ub294 Webservice Get \ud638\ucd9c"},"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 \" >string 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,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"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=484"}],"version-history":[{"count":1,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":485,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/484\/revisions\/485"}],"wp:attachment":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}