Search This Blog

Thursday, July 24, 2008

'HTTP 405 - Resource Not Allowed' in asp

I hit error message 'HTTP 405 - Resource Not Allowed' when trying code below.


sQueryString = Request.Querystring

sUrl = "http://www.xxx.com/index.htm?" & sQueryString

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", sUrl, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send fContent
Response.write xmlhttp.responseText
set xmlhttp = nothing


After debugging, just found out that we are not allow to do post method on a static web "htm" or "html".

Change sUrl = "http://www.xxx.com/index.htm?" & sQueryString to sUrl = "http://www.xxx.com/index.asp?" & sQueryString solve the problem. Of course the file should be exists.

No comments: