// 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.IO; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNet.Http { /// /// Represents the incoming side of an individual HTTP request. /// public abstract class HttpRequest { /// /// Gets the this request; /// public abstract HttpContext HttpContext { get; } /// /// Gets or set the HTTP method. /// /// The HTTP method. public abstract string Method { get; set; } /// /// Gets or set the HTTP request scheme. /// /// The HTTP request scheme. public abstract string Scheme { get; set; } /// /// Returns true if the RequestScheme is https. /// /// true if this request is using https; otherwise, false. public abstract bool IsHttps { get; set; } /// /// Gets or set the Host header. May include the port. /// /// The Host header. public abstract HostString Host { get; set; } /// /// Gets or set the RequestPathBase. /// /// The RequestPathBase. public abstract PathString PathBase { get; set; } /// /// Gets or set the request path from RequestPath. /// /// The request path from RequestPath. public abstract PathString Path { get; set; } /// /// Gets or set the query string. /// /// The query string. public abstract QueryString QueryString { get; set; } /// /// Gets the query value collection parsed from RequestQueryString. /// /// The query value collection parsed from RequestQueryString. public abstract IQueryCollection Query { get; set; } /// /// Gets or set the RequestProtocol. /// /// The RequestProtocol. public abstract string Protocol { get; set; } /// /// Gets the request headers. /// /// The request headers. public abstract IHeaderDictionary Headers { get; } /// /// Gets the collection of Cookies for this request. /// /// The collection of Cookies for this request. public abstract IRequestCookieCollection Cookies { get; set; } /// /// Gets or sets the Content-Length header /// public abstract long? ContentLength { get; set; } /// /// Gets or sets the Content-Type header. /// /// The Content-Type header. public abstract string ContentType { get; set; } /// /// Gets or set the RequestBody Stream. /// /// The RequestBody Stream. public abstract Stream Body { get; set; } /// /// Checks the content-type header for form types. /// public abstract bool HasFormContentType { get; } /// /// Gets or sets the request body as a form. /// public abstract IFormCollection Form { get; set; } /// /// Reads the request body if it is a form. /// /// public abstract Task ReadFormAsync(CancellationToken cancellationToken = new CancellationToken()); } }