-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathIHttpRequestData.cs
More file actions
60 lines (51 loc) · 1.69 KB
/
IHttpRequestData.cs
File metadata and controls
60 lines (51 loc) · 1.69 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.IO;
namespace APIMatic.Core.Http.Abstractions
{
/// <summary>
/// Represents the contract for HTTP request data, including method, URL, headers, body, query parameters, cookies, protocol, content type, and content length.
/// </summary>
public interface IHttpRequestData
{
/// <summary>
/// Gets the HTTP method (e.g., GET, POST, PUT, DELETE).
/// </summary>
string Method { get; }
/// <summary>
/// Gets the request URL.
/// </summary>
Uri Url { get; }
/// <summary>
/// Gets the collection of HTTP headers.
/// </summary>
IReadOnlyDictionary<string, string[]> Headers { get; }
/// <summary>
/// Gets the request body as a stream.
/// </summary>
Stream Body { get; }
/// <summary>
/// Gets the collection of query parameters.
/// </summary>
/// <remarks>
/// Caller owns disposal.
/// </remarks>
IReadOnlyDictionary<string, string[]> Query { get; }
/// <summary>
/// Gets the collection of cookies.
/// </summary>
IReadOnlyDictionary<string, string> Cookies { get; }
/// <summary>
/// Gets the HTTP protocol version (e.g., "HTTP/1.1").
/// </summary>
string Protocol { get; }
/// <summary>
/// Gets the content type of the request (e.g., "application/json").
/// </summary>
string ContentType { get; }
/// <summary>
/// Gets the content length of the request body, if known.
/// </summary>
long? ContentLength { get; }
}
}