forked from stevenh/HttpServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IMessage.cs
53 lines (46 loc) · 1.4 KB
/
IMessage.cs
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
43
44
45
46
47
48
49
50
51
52
53
using System.Collections.Generic;
using System.IO;
using System.Text;
using HttpServer.Headers;
namespace HttpServer
{
/// <summary>
/// Base interface for request and response.
/// </summary>
public interface IMessage : IEnumerable<IHeader>
{
/// <summary>
/// Gets body stream.
/// </summary>
Stream Body { get; }
/// <summary>
/// Size of the body. MUST be specified before sending the header,
/// unless property Chunked is set to <c>true</c>.
/// </summary>
NumericHeader ContentLength { get; }
/// <summary>
/// Kind of content in the body
/// </summary>
/// <remarks>Default is <c>text/html</c></remarks>
ContentTypeHeader ContentType { get; }
/// <summary>
/// Gets or sets encoding
/// </summary>
Encoding Encoding { get; set; }
/// <summary>
/// Gets headers.
/// </summary>
IHeaderCollection Headers { get; }
/// <summary>
/// Add a new header.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
void Add(string name, IHeader value);
/// <summary>
/// Add a new header.
/// </summary>
/// <param name="header">Header to add.</param>
void Add(IHeader header);
}
}