-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIHttp304.cs
More file actions
42 lines (38 loc) · 1.76 KB
/
IHttp304.cs
File metadata and controls
42 lines (38 loc) · 1.76 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
31
32
33
34
35
36
37
38
39
40
41
42
namespace LC6464.ASPNET.Http304;
/// <summary>
/// 快速设置 HTTP 304 状态码。
/// </summary>
public interface IHttp304 {
/// <summary>
/// 强制指定是否设置 HTTP 304 状态码。
/// </summary>
/// <param name="isSet">若为 <see langword="true"/> 则设置</param>
/// <returns>返回 <paramref name="isSet"/>.</returns>
public bool Set(bool isSet = true);
/// <summary>
/// HTTP 协商缓存验证客户端缓存有效性。
/// </summary>
/// <param name="value">附加字符</param>
/// <returns>如果有效,则为 <see langword="true"/>;否则为 <see langword="false"/>.</returns>
public bool IsValid(string value = "");
/// <summary>
/// HTTP 协商缓存验证客户端缓存有效性。
/// </summary>
/// <param name="withIP">是否带上 IP 地址</param>
/// <param name="value">附加字符</param>
/// <returns>如果有效,则为 <see langword="true"/>;否则为 <see langword="false"/>.</returns>
public bool IsValid(bool withIP = false, string value = "");
/// <summary>
/// 验证客户端缓存有效性,若有效,则设置 HTTP 304 状态码。
/// </summary>
/// <param name="value">附加字符</param>
/// <returns>若已设置,则返回 <see langword="true"/>;否则返回 <see langword="false"/> 并向客户端输出相关响应头。</returns>
public bool TrySet(string value = "");
/// <summary>
/// 验证客户端缓存有效性,若有效,则设置 HTTP 304 状态码。
/// </summary>
/// <param name="withIP">是否带上 IP 地址</param>
/// <param name="value">附加字符</param>
/// <returns>若已设置,则返回 <see langword="true"/>;否则返回 <see langword="false"/> 并向客户端输出相关响应头。</returns>
public bool TrySet(bool withIP = false, string value = "");
}