Прочетете на английски

Споделяне чрез


HttpRequestRewindExtensions.EnableBuffering Method

Definition

Overloads

EnableBuffering(HttpRequest)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than 30K bytes to disk.

EnableBuffering(HttpRequest, Int32)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than bufferThreshold bytes to disk.

EnableBuffering(HttpRequest, Int64)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than 30K bytes to disk.

EnableBuffering(HttpRequest, Int32, Int64)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than bufferThreshold bytes to disk.

EnableBuffering(HttpRequest)

Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than 30K bytes to disk.

C#
public static void EnableBuffering (this Microsoft.AspNetCore.Http.HttpRequest request);

Parameters

request
HttpRequest

The HttpRequest to prepare.

Remarks

Temporary files for larger requests are written to the location named in the ASPNETCORE_TEMP environment variable, if any. If that environment variable is not defined, these files are written to the current user's temporary folder. Files are automatically deleted at the end of their associated requests.

Applies to

ASP.NET Core 9.0 и други версии
Продукт Версии
ASP.NET Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

EnableBuffering(HttpRequest, Int32)

Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than bufferThreshold bytes to disk.

C#
public static void EnableBuffering (this Microsoft.AspNetCore.Http.HttpRequest request, int bufferThreshold);

Parameters

request
HttpRequest

The HttpRequest to prepare.

bufferThreshold
Int32

The maximum size in bytes of the in-memory ArrayPool<T> used to buffer the stream. Larger request bodies are written to disk.

Remarks

Temporary files for larger requests are written to the location named in the ASPNETCORE_TEMP environment variable, if any. If that environment variable is not defined, these files are written to the current user's temporary folder. Files are automatically deleted at the end of their associated requests.

Applies to

ASP.NET Core 9.0 и други версии
Продукт Версии
ASP.NET Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

EnableBuffering(HttpRequest, Int64)

Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than 30K bytes to disk.

C#
public static void EnableBuffering (this Microsoft.AspNetCore.Http.HttpRequest request, long bufferLimit);

Parameters

request
HttpRequest

The HttpRequest to prepare.

bufferLimit
Int64

The maximum size in bytes of the request body. An attempt to read beyond this limit will cause an IOException.

Remarks

Temporary files for larger requests are written to the location named in the ASPNETCORE_TEMP environment variable, if any. If that environment variable is not defined, these files are written to the current user's temporary folder. Files are automatically deleted at the end of their associated requests.

Applies to

ASP.NET Core 9.0 и други версии
Продукт Версии
ASP.NET Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

EnableBuffering(HttpRequest, Int32, Int64)

Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs
Source:
HttpRequestRewindExtensions.cs

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than bufferThreshold bytes to disk.

C#
public static void EnableBuffering (this Microsoft.AspNetCore.Http.HttpRequest request, int bufferThreshold, long bufferLimit);

Parameters

request
HttpRequest

The HttpRequest to prepare.

bufferThreshold
Int32

The maximum size in bytes of the in-memory ArrayPool<T> used to buffer the stream. Larger request bodies are written to disk.

bufferLimit
Int64

The maximum size in bytes of the request body. An attempt to read beyond this limit will cause an IOException.

Remarks

Temporary files for larger requests are written to the location named in the ASPNETCORE_TEMP environment variable, if any. If that environment variable is not defined, these files are written to the current user's temporary folder. Files are automatically deleted at the end of their associated requests.

Applies to

ASP.NET Core 9.0 и други версии
Продукт Версии
ASP.NET Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0