C# を使用して、POST からの HTTP 要求の読み取りを制御したいと考えています。主に、ファイル アップロードのストリームを読み取り、multipart/form-data
クライアントから受信したストリームを追跡します。
ProcessRequest
または Asyncを使用するとBeginProcessRequest
、本文は ASP.net / IIS によって既に解析されています。
HTTPHandler を介して組み込みの読み取りをオーバーライドする方法はありますか、それとも別のメカニズムを使用する必要がありますか?
どうもありがとう
アンディ
更新- IHttpHandler を実装した通常のクラスと変わらないが、要求に応じてコード例を追加
public class MyHandler : IHttpHandler
{
public bool IsReusable { get { return true; } }
public void ProcessRequest(HttpContext context)
{
// The body has already been received by the server
// at this point.
// I need a way to access the stream being passed
// from the Client directly, before the client starts
// to actually send the Body of the Request.
}
}