IRequest
A thin wrapper around each host's Request e.g: ASP.NET, HttpListener, MQ, etc
Assembly: ServiceStack.Interfaces.dll
View Source
public interface IRequest : IResolver
Properties
OriginalRequest
The underlying ASP.NET or HttpListener HttpRequest
View Source
object OriginalRequest { get; }
Response
The Response API for this Request
View Source
IResponse Response { get; }
OperationName
The name of the service being called (e.g. Request DTO Name)
View Source
string OperationName { get; set; }
Verb
The Verb / HttpMethod or Action for this request
View Source
string Verb { get; }
RequestAttributes
Different Attribute Enum flags classifying this Request
View Source
RequestAttributes RequestAttributes { get; set; }
RequestPreferences
Optional preferences for the processing of this Request
View Source
IRequestPreferences RequestPreferences { get; }
Dto
The Request DTO, after it has been deserialized.
View Source
object Dto { get; set; }
ContentType
The request ContentType
View Source
string ContentType { get; }
IsLocal
Whether this was an Internal Request
View Source
bool IsLocal { get; }
UserAgent
The UserAgent for the request
View Source
string UserAgent { get; }
Cookies
A Dictionary of HTTP Cookies sent with this Request
View Source
IDictionary<string, Cookie> Cookies { get; }
ResponseContentType
The expected Response ContentType for this request
View Source
string ResponseContentType { get; set; }
HasExplicitResponseContentType
Whether the ResponseContentType has been explicitly overridden or whether it was just the default
View Source
bool HasExplicitResponseContentType { get; }
Items
Attach any data to this request that all filters and services can access.
View Source
Dictionary<string, object> Items { get; }
Headers
The HTTP Headers in a NameValueCollection
View Source
NameValueCollection Headers { get; }
QueryString
The ?query=string in a NameValueCollection
View Source
NameValueCollection QueryString { get; }
FormData
The HTTP POST'ed Form Data in a NameValueCollection
View Source
NameValueCollection FormData { get; }
UseBufferedStream
Buffer the Request InputStream so it can be re-read
View Source
bool UseBufferedStream { get; set; }
RawUrl
Relative URL containing /path/info?query=string
View Source
string RawUrl { get; }
AbsoluteUri
The Absolute URL for the request
View Source
string AbsoluteUri { get; }
UserHostAddress
The Remote IP as reported by Request.UserHostAddress
View Source
string UserHostAddress { get; }
RemoteIp
The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress
View Source
string RemoteIp { get; }
Authorization
The value of the Authorization Header used to send the Api Key, null if not available
View Source
string Authorization { get; }
IsSecureConnection
e.g. is https or not
View Source
bool IsSecureConnection { get; }
AcceptTypes
Array of different Content-Types accepted by the client
View Source
string[] AcceptTypes { get; }
PathInfo
The normalized /path/info for the request
View Source
string PathInfo { get; }
OriginalPathInfo
The original /path/info as sent
View Source
string OriginalPathInfo { get; }
InputStream
The Request Body Input Stream
View Source
Stream InputStream { get; }
ContentLength
The size of the Request Body if provided
View Source
long ContentLength { get; }
Files
Access to the multi-part/formdata files posted on this request
View Source
IHttpFile[] Files { get; }
UrlReferrer
The value of the Referrer, null if not available
View Source
Uri UrlReferrer { get; }
Methods
GetRawBody()
The entire string contents of Request.InputStream
View Source
string GetRawBody()
Returns
System.String
GetRawBodyAsync()
The entire string contents of Request.InputStream async
View Source
Task<string> GetRawBodyAsync()
Returns
System.Threading.Tasks.Task<System.String>