Internal server error for PUT and DELETE

Nov 20, 2008 at 9:33 PM
Hi everyone,

I started using IIRF about a month back. It has worked fine for me for GET and POST requests, but I face issues with PUT and DELETE requests. Can anyone suggest what might be wrong?

I have a Windows XP SP2 machine with IIS 5.1 installed. My ini file is like this:

RewriteLog  C:\windows\system32\inetsrv\iirf\logs\rewrite.log

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule /MySite/(.*) /MySite/index.aspx [L,U]

I'm making an http request to this website as follows from a different application:

   class Program
        static void Main(string[] args)
            WebRequest req = HttpWebRequest.Create("http://localhost/MySite/social/rest/appdata/john.doe/@self/1?fields=pokes,last_poke");
            req.Method = "DELETE";

            WebResponse resp = req.GetResponse();

I get an internal error (500) from IIS. The call doesn't even reach my page (index.aspx). However GET and POST works fine, so I assume it is a misconfiguration with IIS.

Can someone help me? Thanks in advance


Nov 30, 2008 at 10:38 PM
Edited Nov 30, 2008 at 10:43 PM
ah, hmmm, you know, I've not tested the filter with PUT and DELETE.
Love to understand what you are doing here, to understand what you need out of it. 

How do you generate the PUTs and DELETEs?  I mean I see your .NET code - is this really how you will be generating the requests?  And if that is how you are generating them, then why not just generate the requests to the proper URL in the first place?

As you know, URL rewriting is primarily useful for GET requests, particularly for search engine optimization.  With PUTs and DELETEs, it sounds like you are building a REST application.  So I don't understand why you would want to build the app this way.

Maybe you could explain what you are thinking, so I have some better insight into what you are trying to do?