<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>status of 405 &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/status-of-405/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:23:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>status of 405 &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Solutions for the error &#8220;the server responded with a status of 405 (method not allowed)&#8221;</title>
		<link>https://www.sibeeshpassion.com/solutions-for-the-error-the-server-responded-with-a-status-of-405-method-not-allowed/</link>
					<comments>https://www.sibeeshpassion.com/solutions-for-the-error-the-server-responded-with-a-status-of-405-method-not-allowed/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 08 Feb 2016 10:04:13 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Web API]]></category>
		<category><![CDATA[MapHttpRoute]]></category>
		<category><![CDATA[method not allowed]]></category>
		<category><![CDATA[status of 405]]></category>
		<category><![CDATA[WebApiConfig]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11206</guid>

					<description><![CDATA[[toc] Introduction I was working with Web API for one of my new project, suddenly I got this error &#8220;the server responded with a status of 405 (method not allowed)&#8221; when I try to delete a record through API. I have started to scratch my head. And finally I got the solution for the same. Here I am going to share you that solution. I hope you will like this. Following are the solutions that you can try out if you get this error. Solution 1: Changing Web.Config file This is the first thing you must try. Please add the [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction</h2>



<p>I was working with <a href="http://sibeeshpassion.com/category/web-api/" target="_blank" rel="noopener noreferrer">Web API</a> for one of my new project, suddenly I got this error &#8220;the server responded with a status of 405 (method not allowed)&#8221; when I try to delete a record through API. I have started to scratch my head. And finally I got the solution for the same. Here I am going to share you that solution. I hope you will like this.</p>



<p>Following are the solutions that you can try out if you get this error.</p>



<h2 class="wp-block-heading">Solution 1: Changing Web.Config file</h2>



<p>This is the first thing you must try. Please add the below tags in the Web.Config file under modules .</p>



<script src="https://gist.github.com/SibeeshVenu/1f7611b375446b9c71b9f2ae30499c1b.js"></script>



<p>If you are getting the error still, try adding one tag under handlers as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/2c82afb82beeeae681dd1085b9a0ad51.js"></script>



<p>If the above didn&#8217;t work for you, you can go to the next solution.</p>



<h2 class="wp-block-heading">Solution 2: Revert back the parameter name</h2>



<p>As you all know we have a file called WebApiConfig.cs where we set the <em>MapHttpRoute</em> and other config filters.</p>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/02/WebApi-Config-File.png"><img fetchpriority="high" decoding="async" width="376" height="167" src="http://sibeeshpassion.com/wp-content/uploads/2016/02/WebApi-Config-File.png" alt="WebApi Config File" class="wp-image-11207" srcset="/wp-content/uploads/2016/02/WebApi-Config-File.png 376w, /wp-content/uploads/2016/02/WebApi-Config-File-300x133.png 300w" sizes="(max-width: 376px) 100vw, 376px" /></a><figcaption>WebApi Config File</figcaption></figure>



<p>By default the parameter here is &#8216;id&#8217; as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/1d46fbe92d84d294f3df9e6ac64264f1.js"></script>



<p>Now if you changed the parameter of your function in any case, you need to revert it back to &#8216;id&#8217;, or you need to make changes in the WebApiConfig.cs file.</p>



<p>For Example, below is my delete function.</p>



<script src="https://gist.github.com/SibeeshVenu/6f4400b1e5b0a81de403b34d966ae4f6.js"></script>



<p>As you can see I have changed my parameter to &#8216;subId&#8217;. Because of this I was getting the error &#8220;the server responded with a status of 405 (method not allowed)&#8221; always. Then I changed my function as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/b4cdafba142e754919ed7774c3a47878.js"></script>



<p>It works fine after I have changed the parameter name. I hope you find it helpful. That is all. We did it. Have a happy coding.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Did I miss anything that you may think which is needed? Did you try Web API yet? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/solutions-for-the-error-the-server-responded-with-a-status-of-405-method-not-allowed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
