{"id":48,"date":"2020-06-02T20:15:27","date_gmt":"2020-06-02T20:15:27","guid":{"rendered":"http:\/\/bahadirmeric.net\/bahadir\/?p=48"},"modified":"2020-06-02T20:15:27","modified_gmt":"2020-06-02T20:15:27","slug":"webrequesti-get-metoduyla-kullanmak","status":"publish","type":"post","link":"http:\/\/bahadirmeric.net\/bahadir\/2020\/06\/02\/webrequesti-get-metoduyla-kullanmak\/","title":{"rendered":"WebRequest\u2019i GET Metoduyla kullanmak"},"content":{"rendered":"\n<p>Normalde WebRequest POST metoduyla kullan\u0131l\u0131r ve POST edilen de\u011ferler ilgili sayfada kar\u015f\u0131lan\u0131p i\u015flem g\u00f6rd\u00fckten sonra geriye d\u00f6nen sayfa sonucu al\u0131n\u0131p i\u00e7indeki veri k\u00fcmeleri yada d\u00f6nen sonuca g\u00f6re bizim tarafta i\u015flem yap\u0131lmas\u0131 sa\u011flan\u0131r. Fakat GET metoduyla bir de\u011fer g\u00f6nderip alaca\u011f\u0131m\u0131z de\u011fer \u00fczerinde de bir ka\u00e7 i\u015flem yap\u0131p ba\u015fka bir web sayfas\u0131na ula\u015fmam\u0131z yada y\u00f6nlenmemiz gereken durumlar olabilir.<\/p>\n\n\n\n<p>\u0130\u015fte b\u00f6yle durumlarda sizlere tavsiyem a\u015fa\u011f\u0131daki gibi bir teknik ile de\u011feri g\u00f6ndermenizdir.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\nusing System.Net;\nusing System.IO;\n \nnamespace Mi4Biz\n{\n    public partial class Default : System.Web.UI.Page\n    {\n        protected void Page_Load(object sender, EventArgs e)\n        {\n             string getTokenUri = &quot;http:\/\/localhost:10338\/TestRequest.aspx?ersponse_type=token&amp;bc_id=315&amp;scope=customer_create_issue&amp;nonce=315&quot;;\n             WebRequest reg = WebRequest.Create(getTokenUri);\nStream objStream = reg.GetResponse().GetResponseStream();\nStreamReader objReader = new StreamReader(objStream);\nstring sLine = &quot;&quot;;\nint i = 0;\nwhile (sLine != null)\n{\ni++;\nsLine = objReader.ReadLine();\nif (sLine != null)\nResponse.Write(i + &quot;. &quot; + sLine);\n}\n        }\n    }\n}\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Normalde WebRequest POST metoduyla kullan\u0131l\u0131r ve POST edilen de\u011ferler ilgili sayfada kar\u015f\u0131lan\u0131p i\u015flem g\u00f6rd\u00fckten sonra geriye d\u00f6nen sayfa sonucu al\u0131n\u0131p i\u00e7indeki veri k\u00fcmeleri yada d\u00f6nen sonuca g\u00f6re bizim tarafta i\u015flem yap\u0131lmas\u0131 sa\u011flan\u0131r. Fakat GET metoduyla bir de\u011fer g\u00f6nderip alaca\u011f\u0131m\u0131z de\u011fer \u00fczerinde de bir ka\u00e7 i\u015flem yap\u0131p ba\u015fka bir web sayfas\u0131na&#8230; <a class=\"continue-reading-link\" href=\"http:\/\/bahadirmeric.net\/bahadir\/2020\/06\/02\/webrequesti-get-metoduyla-kullanmak\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":16,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[7,4,6],"class_list":["post-48","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","tag-asp-net","tag-c","tag-visual-studio"],"_links":{"self":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":1,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":49,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts\/48\/revisions\/49"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/media\/16"}],"wp:attachment":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}