//Copyright (c) Service Stack LLC. All Rights Reserved.
//License: https://raw.github.com/ServiceStack/ServiceStack/master/license.txt
using System;
using System.Collections.Generic;
using System.IO;
using ServiceStack.Configuration;
namespace ServiceStack.Web
{
///
/// A thin wrapper around each host's Request e.g: ASP.NET, HttpListener, MQ, etc
///
public interface IRequest : IResolver
{
///
/// The underlying ASP.NET or HttpListener HttpRequest
///
object OriginalRequest { get; }
IResponse Response { get; }
///
/// The name of the service being called (e.g. Request DTO Name)
///
string OperationName { get; set; }
///
/// The Verb / HttpMethod or Action for this request
///
string Verb { get; }
RequestAttributes RequestAttributes { get; set; }
///
/// Optional preferences for the processing of this Request
///
IRequestPreferences RequestPreferences { get; }
///
/// The Request DTO, after it has been deserialized.
///
object Dto { get; set; }
///
/// The request ContentType
///
string ContentType { get; }
bool IsLocal { get; }
string UserAgent { get; }
IDictionary Cookies { get; }
///
/// The expected Response ContentType for this request
///
string ResponseContentType { get; set; }
///
/// Whether the ResponseContentType has been explicitly overrided or whether it was just the default
///
bool HasExplicitResponseContentType { get; }
///
/// Attach any data to this request that all filters and services can access.
///
Dictionary Items { get; }
INameValueCollection Headers { get; }
INameValueCollection QueryString { get; }
INameValueCollection FormData { get; }
///
/// Buffer the Request InputStream so it can be re-read
///
bool UseBufferedStream { get; set; }
///
/// The entire string contents of Request.InputStream
///
///
string GetRawBody();
string RawUrl { get; }
string AbsoluteUri { get; }
///
/// The Remote Ip as reported by Request.UserHostAddress
///
string UserHostAddress { get; }
///
/// The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress
///
string RemoteIp { get; }
///
/// The value of the Authorization Header used to send the Api Key, null if not available
///
string Authorization { get; }
///
/// e.g. is https or not
///
bool IsSecureConnection { get; }
string[] AcceptTypes { get; }
string PathInfo { get; }
Stream InputStream { get; }
long ContentLength { get; }
///
/// Access to the multi-part/formdata files posted on this request
///
IHttpFile[] Files { get; }
///
/// The value of the Referrer, null if not available
///
Uri UrlReferrer { get; }
}
}