{"id":1368,"date":"2019-04-23T10:26:25","date_gmt":"2019-04-23T07:26:25","guid":{"rendered":"http:\/\/www.domainhizmetleri.com\/blog\/?p=1368"},"modified":"2021-09-14T01:18:04","modified_gmt":"2021-09-13T22:18:04","slug":"net-core-api-icin-405-methot-not-allowed-cozumu","status":"publish","type":"post","link":"https:\/\/www.domainhizmetleri.com\/blog\/net-core-api-icin-405-methot-not-allowed-cozumu\/","title":{"rendered":".NET Core API i\u00e7in &#8220;405 Methot Not Allowed&#8221; \u00c7\u00f6z\u00fcm\u00fc"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Yaz\u0131 \u0130\u00e7eri\u011fi<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"\u0130\u00e7indekiler Tablosunu A\u00e7\/Kapat\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #0a0a0a;color:#0a0a0a\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #0a0a0a;color:#0a0a0a\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/net-core-api-icin-405-methot-not-allowed-cozumu\/#Cozumu_WebConfig_duzenlemesi\" >\u00c7\u00f6z\u00fcm\u00fc: Web.Config d\u00fczenlemesi<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/net-core-api-icin-405-methot-not-allowed-cozumu\/#Alternatif_Yontem_IIS_uzerinden_WebDAV_Bilesenini_kaldirmak\" >Alternatif Y\u00f6ntem: IIS \u00fczerinden WebDAV Bile\u015fenini kald\u0131rmak<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<p>Son zamanlarda RestFUL API olu\u015fturan kullan\u0131c\u0131lar\u0131n HTTP DELETE veya PUT istekleri yaparken bir sorun kar\u015f\u0131s\u0131nda ald\u0131klar\u0131 &#8220;405 Y\u00f6ntemine \u0130zin Verilmiyor&#8221; hatas\u0131 s\u0131kla\u015fmaya ba\u015flad\u0131.<\/p>\n<p>Bu durumun ba\u015fl\u0131ca sebebi IIS&gt;WebDAV bile\u015fenidir.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Cozumu_WebConfig_duzenlemesi\"><\/span><strong>\u00c7\u00f6z\u00fcm\u00fc: Web.Config d\u00fczenlemesi<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>En pratik \u00e7\u00f6z\u00fcm\u00fc .NET Core projenizin Web.Config dosyas\u0131na a\u015fa\u011f\u0131daki kod d\u00fczene\u011fini yerle\u015ftirmek olacakt\u0131r. \u00c7\u00fcnk\u00fc e\u011fer bir payla\u015f\u0131ml\u0131 hosting kullan\u0131yorsan\u0131z&nbsp; <strong>handlers<\/strong> y\u00f6netimi sayesinde bu \u00f6zelli\u011fi kendinize uyarlayabilirsiniz.<\/p>\n<p><em>\u015eimdi 2 i\u015flem yapaca\u011f\u0131z,<\/em><\/p>\n<p>\u0130lki, Web.config dosyan\u0131z\u0131 a\u00e7t\u0131ktan sonra <strong>&lt;handlers&gt;<\/strong> sat\u0131r\u0131n\u0131 bulup hemen alt\u0131na \u015fu kodu yerle\u015ftirin:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-theme=\"enlighter\">&lt;remove name=\"WebDAV\" \/&gt;<\/pre>\n<p>\u0130kincisi, ayn\u0131 Web.config dosyas\u0131nda <strong>&lt;\/system.webServer&gt;<\/strong> sat\u0131r\u0131n\u0131n hemen bir \u00fcst sat\u0131r\u0131na a\u015fa\u011f\u0131daki sat\u0131rlar\u0131 yerle\u015ftirin. E\u011fer hali haz\u0131rda &lt;modules&gt; taglar\u0131 var ise i\u00e7ine ekleyebilirsiniz:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-theme=\"enlighter\">&lt;modules&gt;\n  &lt;remove name=\"WebDAVModule\" \/&gt;\n&lt;\/modules&gt;<\/pre>\n<p>Bu i\u015flem ard\u0131ndan web.config dosyan\u0131zda \u00f6rnek olarak \u015fu \u015fekilde g\u00f6r\u00fcnecektir:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"ini\" data-enlighter-highlight=\"7, 10-12\" data-enlighter-theme=\"enlighter\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n  &lt;location path=\".\" inheritInChildApplications=\"false\"&gt;\n    &lt;system.webServer&gt;\n      &lt;handlers&gt;\n        &lt;add name=\"aspNetCore\" path=\"*\" verb=\"*\" modules=\"AspNetCoreModuleV2\" resourceType=\"Unspecified\" \/&gt;\n        &lt;remove name=\"WebDAV\" \/&gt;\n      &lt;\/handlers&gt;\n      &lt;aspNetCore processPath=\".\\XXXXXX.exe\" stdoutLogEnabled=\"false\" stdoutLogFile=\".\\logs\\stdout\" \/&gt;\n      &lt;modules&gt;\n        &lt;remove name=\"WebDAVModule\" \/&gt;\n      &lt;\/modules&gt;\n    &lt;\/system.webServer&gt;\n  &lt;\/location&gt;\n&lt;\/configuration&gt;\n&lt;!--ProjectGuid: 22xx698-2abd-4dfc-8f89-06bxxxxc9845--&gt;<\/pre>\n<p>Art\u0131k API projeniz bu sorunu ya\u015famaycakt\u0131r.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Alternatif_Yontem_IIS_uzerinden_WebDAV_Bilesenini_kaldirmak\"><\/span><strong><em>Alternatif Y\u00f6ntem: IIS \u00fczerinden WebDAV Bile\u015fenini kald\u0131rmak<\/em><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Kendinize ait bir sunucuda bu sorunu ya\u015f\u0131yorsan\u0131z, WebDAV&#8217;\u0131 iptal ederek kal\u0131c\u0131 \u015fekilde \u00e7\u00f6zebilirsiniz.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1369 size-full\" src=\"https:\/\/www.domainhizmetleri.com\/blog\/wp-content\/uploads\/remove-webdav.png\" alt=\"\" width=\"621\" height=\"465\" srcset=\"https:\/\/www.domainhizmetleri.com\/blog\/wp-content\/uploads\/remove-webdav.png 621w, https:\/\/www.domainhizmetleri.com\/blog\/wp-content\/uploads\/remove-webdav-300x225.png 300w, https:\/\/www.domainhizmetleri.com\/blog\/wp-content\/uploads\/remove-webdav-195x146.png 195w, https:\/\/www.domainhizmetleri.com\/blog\/wp-content\/uploads\/remove-webdav-50x37.png 50w, https:\/\/www.domainhizmetleri.com\/blog\/wp-content\/uploads\/remove-webdav-100x75.png 100w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Son zamanlarda RestFUL API olu\u015fturan kullan\u0131c\u0131lar\u0131n HTTP DELETE veya PUT istekleri yaparken bir sorun kar\u015f\u0131s\u0131nda ald\u0131klar\u0131 &#8220;405 Y\u00f6ntemine \u0130zin Verilmiyor&#8221; hatas\u0131 s\u0131kla\u015fmaya ba\u015flad\u0131. Bu durumun ba\u015fl\u0131ca sebebi IIS&gt;WebDAV bile\u015fenidir. \u00c7\u00f6z\u00fcm\u00fc: Web.Config d\u00fczenlemesi En pratik \u00e7\u00f6z\u00fcm\u00fc .NET Core projenizin Web.Config dosyas\u0131na a\u015fa\u011f\u0131daki kod d\u00fczene\u011fini yerle\u015ftirmek olacakt\u0131r. \u00c7\u00fcnk\u00fc e\u011fer bir payla\u015f\u0131ml\u0131 hosting kullan\u0131yorsan\u0131z&nbsp; handlers y\u00f6netimi sayesinde bu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2570,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142],"tags":[75,111,110,100,8],"class_list":["post-1368","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-yazilim-pratikleri","tag-net-core","tag-api","tag-handlers","tag-web-config","tag-windows"],"views":4580,"_links":{"self":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts\/1368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/comments?post=1368"}],"version-history":[{"count":2,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts\/1368\/revisions"}],"predecessor-version":[{"id":2572,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts\/1368\/revisions\/2572"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/media\/2570"}],"wp:attachment":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/media?parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/categories?post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/tags?post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}