POST
Webサーバーのデフォルトページにデータを形成したいのですが、例:
POST http://errorreporting.example.com/ HTTP/1.1
私はサーバーが302
クライアントを行くべき場所にリダイレクトする責任を負わせたいですPOST
。default.asp
サーバー上のファイルは、:を実行することにより、このタスク( Microsoftが推奨する手法)を実行しRedirect
ます。
default.asp:
<%
Response.Redirect "SubmitError.ashx"
%>
サーバーを閲覧するだけの場合:
GET http://errorreporting.example.com/ HTTP/1.1
サーバーから期待される応答を取得します。
HTTP/1.1 302 Object moved
Server: Microsoft-IIS/5.0
Location: SubmitError.ashx
...
しかし、私POST
がサーバーに行くとき:
POST http://errorreporting.example.com/ HTTP/1.1
サーバーは私と非常に不機嫌になります:
HTTP/1.1 405 Method not allowed
Connection: close
Allow: OPTIONS, TRACE, GET, HEAD
...
クライアントをURLでハードコーディングするのではなく、サーバーがクライアントを適切な送信にリダイレクトできるようにしたい。もちろん、これはURLが変更された(つまり変更された)可能性があるためです。URL
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
等
注URL
:ドキュメントの場所を含めるようにを変更した場合:
/* 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';
それはうまくいきます:
HTTP/1.1 200 OK