HttpRequest.InsertEntityBody HttpRequest.InsertEntityBody HttpRequest.InsertEntityBody HttpRequest.InsertEntityBody Method

定义

为用于将 HTTP 请求实体正文插入内存的 IIS 方法提供托管包装。Provides a managed wrapper for the IIS method that inserts an HTTP request entity body into memory.

重载

InsertEntityBody() InsertEntityBody() InsertEntityBody() InsertEntityBody()

向 IIS 提供 HTTP 请求实体正文的副本。Provides IIS with a copy of the HTTP request entity body.

InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32)

向 IIS 提供 HTTP 请求实体正文的副本以及有关请求实体对象的信息。Provides IIS with a copy of the HTTP request entity body and with information about the request entity object.

注解

方法重载提供对 IIS 7 IHttpRequest::InsertEntityBody方法的托管访问。 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.

备注

方法重载仅适用于 iis 7.0 或更高版本,因为该方法是在 iis 7.0 中添加的IHttpRequest::InsertEntityBodyInsertEntityBodyThe InsertEntityBody method overloads work only on IIS 7.0 or later, because the IHttpRequest::InsertEntityBody method was added in IIS 7.0.

InsertEntityBody() InsertEntityBody() InsertEntityBody() InsertEntityBody()

向 IIS 提供 HTTP 请求实体正文的副本。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.

安全性

AspNetHostingPermission
用于在宿主环境中操作。For operating in a hosted environment. 安全操作: DemandSecurity action: Demand. 关联的枚举:HighAssociated enumeration: High

InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32)

向 IIS 提供 HTTP 请求实体正文的副本以及有关请求实体对象的信息。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 Int32 Int32 Int32

buffer 中开始存储请求实体数据的位置,该位置从零开始计数。The zero-based position in buffer at which to begin storing the request entity data.

count
Int32 Int32 Int32 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.

如果给定 offset 值,则 count 中的项目数大于 buffer 中的可用空间。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.InsertEntityBodyThe HttpRequest.InsertEntityBody method overload is useful when you want to perform custom processing, such as inserting a different entity body into memory.

安全性

AspNetHostingPermission
用于在宿主环境中进行操作。for operating in a hosted environment. 安全操作: DemandSecurity action: Demand. 关联的枚举:HighAssociated enumeration: High

适用于