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 = "" & sQueryString

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") "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 = "" & sQueryString to sUrl = "" & sQueryString solve the problem. Of course the file should be exists.

No comments: