forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIHostBufferPolicySelector.cs
More file actions
30 lines (27 loc) · 1.5 KB
/
Copy pathIHostBufferPolicySelector.cs
File metadata and controls
30 lines (27 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Net.Http;
namespace System.Web.Http.Hosting
{
/// <summary>
/// Interface for controlling the use of buffering requests and responses in the host. If a host
/// provides support for buffering requests and/or responses then it can use this interface to
/// determine the policy for when buffering is to be used.
/// </summary>
public interface IHostBufferPolicySelector
{
/// <summary>
/// Determines whether the host should buffer the entity body when processing a request with content.
/// </summary>
/// <param name="hostContext">The host-specific context.</param>
/// <returns><c>true</c> if buffering should be used; otherwise a streamed request should be used.</returns>
bool UseBufferedInputStream(object hostContext);
/// <summary>
/// Determines whether the host should buffer the <see cref="HttpResponseMessage"/> entity body.
/// </summary>
/// <param name="response">The <see cref="HttpResponseMessage"/>response for which to determine
/// whether host output buffering should be used for the response entity body.</param>
/// <returns><c>true</c> if buffering should be used; otherwise a streamed response should be used.</returns>
bool UseBufferedOutputStream(HttpResponseMessage response);
}
}