i want to POST
form data to the default page of a web-server, e.g.:
POST http://errorreporting.example.com/ HTTP/1.1
i want the server to be responsible for 302
redirecting the client to where the POST
should go. The default.asp
file on the server performs this task (which is the technique Microsoft recommends), by performing the Redirect
:
default.asp:
<%
Response.Redirect "SubmitError.ashx"
%>
When i simply browse the server:
GET http://errorreporting.example.com/ HTTP/1.1
i get the expected response from the server:
HTTP/1.1 302 Object moved
Server: Microsoft-IIS/5.0
Location: SubmitError.ashx
...
But when i POST
to the server:
POST http://errorreporting.example.com/ HTTP/1.1
The server gets very grumpy with me:
HTTP/1.1 405 Method not allowed
Connection: close
Allow: OPTIONS, TRACE, GET, HEAD
...
i want the server to be able to redirect the client to the appropriate submit URL
, rather than hard-coding the client with the URL. This is, of course, because the URL could (i.e. has) changed:
http://errorreporting.example.com/SubmitError.asp
http://errorreporting.example.com/SubmitError.aspx
http://errorreporting.example.com/SubmitError.ashx
http://errorreporting.example.com/ErrorReporting/Submit.ashx
http://errorreporting.example.com/submiterror.php
http://errorreporting.example.com/submit/submiterror.ashx
etc.
Note: If i change the URL
to include the document location:
/* SErrorReportingUrl = 'http://www.example.com:8088/ErrorReporting/SubmitError.ashx';
SErrorReportingUrl = 'http://www.example.com/ErrorReporting/SubmitError.ashx';
SErrorReportingUrl = 'http://errorreporting.example.com:8088/ErrorReporting/SubmitError.ashx';
SErrorReportingUrl = 'http://errorreporting.example.com/SubmitError.ashx';
SErrorReportingUrl = 'http://errorreporting.example.com';
SErrorReportingUrl = 'http://errorreporting.example.com/SubmitError.ashx';
*/
SErrorReportingUrl = 'http://errorreporting.example.com/submit/SubmitError.ashx';
It works fine:
HTTP/1.1 200 OK