This repository was archived by the owner on Nov 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathHttpRequest.cs
More file actions
113 lines (94 loc) · 3.98 KB
/
HttpRequest.cs
File metadata and controls
113 lines (94 loc) · 3.98 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.AspNet.Http
{
public abstract class HttpRequest
{
public abstract HttpContext HttpContext { get; }
/// <summary>
/// Gets or set the HTTP method.
/// </summary>
/// <returns>The HTTP method.</returns>
public abstract string Method { get; set; }
/// <summary>
/// Gets or set the HTTP request scheme from owin.RequestScheme.
/// </summary>
/// <returns>The HTTP request scheme from owin.RequestScheme.</returns>
public abstract string Scheme { get; set; }
/// <summary>
/// Returns true if the owin.RequestScheme is https.
/// </summary>
/// <returns>true if this request is using https; otherwise, false.</returns>
public abstract bool IsHttps { get; }
/// <summary>
/// Gets or set the Host header. May include the port.
/// </summary>
/// <return>The Host header.</return>
public abstract HostString Host { get; set; }
/// <summary>
/// Gets or set the owin.RequestPathBase.
/// </summary>
/// <returns>The owin.RequestPathBase.</returns>
public abstract PathString PathBase { get; set; }
/// <summary>
/// Gets or set the request path from owin.RequestPath.
/// </summary>
/// <returns>The request path from owin.RequestPath.</returns>
public abstract PathString Path { get; set; }
/// <summary>
/// Gets or set the query string from owin.RequestQueryString.
/// </summary>
/// <returns>The query string from owin.RequestQueryString.</returns>
public abstract QueryString QueryString { get; set; }
/// <summary>
/// Gets the query value collection parsed from owin.RequestQueryString.
/// </summary>
/// <returns>The query value collection parsed from owin.RequestQueryString.</returns>
public abstract IReadableStringCollection Query { get; }
/// <summary>
/// Gets or set the owin.RequestProtocol.
/// </summary>
/// <returns>The owin.RequestProtocol.</returns>
public abstract string Protocol { get; set; }
/// <summary>
/// Gets the request headers.
/// </summary>
/// <returns>The request headers.</returns>
public abstract IHeaderDictionary Headers { get; }
/// <summary>
/// Gets the collection of Cookies for this request.
/// </summary>
/// <returns>The collection of Cookies for this request.</returns>
public abstract IReadableStringCollection Cookies { get; }
/// <summary>
/// Gets or sets the Content-Length header
/// </summary>
public abstract long? ContentLength { get; set; }
/// <summary>
/// Gets or sets the Content-Type header.
/// </summary>
/// <returns>The Content-Type header.</returns>
public abstract string ContentType { get; set; }
/// <summary>
/// Gets or set the owin.RequestBody Stream.
/// </summary>
/// <returns>The owin.RequestBody Stream.</returns>
public abstract Stream Body { get; set; }
/// <summary>
/// Checks the content-type header for form types.
/// </summary>
public abstract bool HasFormContentType { get; }
/// <summary>
/// Gets or sets the request body as a form.
/// </summary>
public abstract IFormCollection Form { get; set; }
/// <summary>
/// Reads the request body if it is a form.
/// </summary>
/// <returns></returns>
public abstract Task<IFormCollection> ReadFormAsync(CancellationToken cancellationToken = new CancellationToken());
}
}