HttpRequest.InsertEntityBody 方法

定義

提供 IIS 方法的 Managed 包裝函式,這個方法會將 HTTP 要求實體本文插入記憶體中。Provides a managed wrapper for the IIS method that inserts an HTTP request entity body into memory.

多載

InsertEntityBody()

將 HTTP 要求實體本文的複本提供給 IIS。Provides IIS with a copy of the HTTP request entity body.

InsertEntityBody(Byte[], Int32, Int32)

將 HTTP 要求實體本文的複本及該要求實體物件的相關資訊提供給 IIS。Provides IIS with a copy of the HTTP request entity body and with information about the request entity object.

備註

方法多載會 InsertEntityBody 提供 IIS 7 方法的 managed 存取權 IHttpRequest::InsertEntityBodyThe InsertEntityBody method overloads provide managed access to the IIS 7 IHttpRequest::InsertEntityBody method. IIS 方法會將 HTTP 要求實體內容插入 (用戶端) 張貼到記憶體中的資料。The IIS method inserts an HTTP request entity body (the data that is posted by a client) into memory. 這項功能很有用,因為 IIS 在讀取之後不會維持要求實體的複本。This is useful because IIS does not maintain a copy of the request entity after it has been read. 這些 InsertEntityBody 方法會建立 HTTP 要求實體資料的複本,並將它提供給 IIS 以進行額外的自訂處理。The InsertEntityBody methods create a copy of the HTTP request entity data and make it available to IIS for additional custom handling.

注意

方法多載 InsertEntityBody 只會在 iis 7.0 或更新版本上運作,因為 IHttpRequest::InsertEntityBody 已在 iis 7.0 中加入方法。The InsertEntityBody method overloads work only on IIS 7.0 or later, because the IHttpRequest::InsertEntityBody method was added in IIS 7.0.

InsertEntityBody()

將 HTTP 要求實體本文的複本提供給 IIS。Provides IIS with a copy of the HTTP request entity body.

public:
 void InsertEntityBody();
public void InsertEntityBody ();
member this.InsertEntityBody : unit -> unit
Public Sub InsertEntityBody ()

例外狀況

已在比 IIS 7.0 版舊的 IIS 上叫用此方法。The method was invoked on a version of IIS earlier than IIS 7.0.

備註

IIS 在讀取後不會保留要求的複本。IIS does not maintain a copy of the request after it has been read. 因此,建議只有 HTTP 要求的處理常式才能讀取要求實體。Therefore, it is recommended that only the handler for an HTTP request should read the request entity.

HttpRequest.InsertEntityBody如果先前已由 ASP.NET 讀取,方法多載會為 IIS 提供一個要求實體的複本。The HttpRequest.InsertEntityBody method overload provides IIS with a copy of the request entity if it was previously read by ASP.NET. 此方法多載適用于 ASP.NET 已讀取實體要求的情況,而且您想要重複使用現有的要求資料。This method overload is useful for cases where ASP.NET has read the entity request and you want to reuse the existing request data.

適用於

InsertEntityBody(Byte[], Int32, Int32)

將 HTTP 要求實體本文的複本及該要求實體物件的相關資訊提供給 IIS。Provides IIS with a copy of the HTTP request entity body and with information about the request entity object.

public:
 void InsertEntityBody(cli::array <System::Byte> ^ buffer, int offset, int count);
public void InsertEntityBody (byte[] buffer, int offset, int count);
member this.InsertEntityBody : byte[] * int * int -> unit
Public Sub InsertEntityBody (buffer As Byte(), offset As Integer, count As Integer)

參數

buffer
Byte[]

包含要求實體資料的陣列。An array that contains the request entity data.

offset
Int32

buffer 中要開始儲存該要求實體資料的位置 (以零為起始)。The zero-based position in buffer at which to begin storing the request entity data.

count
Int32

要讀入 buffer 陣列的位元組數目。The number of bytes to read into the buffer array.

例外狀況

已在比 IIS 7.0 版舊的 IIS 上叫用此方法。The method was invoked on a version of IIS earlier than IIS 7.0.

buffernullbuffer is null.

offsetcount 為負值。offset or count is a negative value.

在指定 count 值的情況下,buffer 中的項目數大於 offset 的可用空間。The number of items in count is larger than the available space in buffer, given the offset value.

備註

IIS 在讀取後不會保留要求的複本。IIS does not maintain a copy of the request after it has been read. 因此,建議只有 HTTP 要求的處理常式才能讀取要求實體。Therefore, it is recommended that only the handler for an HTTP request should read the request entity.

HttpRequest.InsertEntityBody當您想要執行自訂處理(例如將不同的實體主體插入記憶體中)時,方法多載會很有用。The HttpRequest.InsertEntityBody method overload is useful when you want to perform custom processing, such as inserting a different entity body into memory.

適用於