Skip to main content

IRequest

A thin wrapper around each host's Request e.g: ASP.NET, HttpListener, MQ, etc

Assembly: ServiceStack.Interfaces.dll​
View Source​
Declaration
public interface IRequest : IResolver

Properties​

OriginalRequest​

The underlying ASP.NET or HttpListener HttpRequest

View Source​
Declaration
object OriginalRequest { get; }

Response​

The Response API for this Request

View Source​
Declaration
IResponse Response { get; }

OperationName​

The name of the service being called (e.g. Request DTO Name)

View Source​
Declaration
string OperationName { get; set; }

Verb​

The Verb / HttpMethod or Action for this request

View Source​
Declaration
string Verb { get; }

RequestAttributes​

Different Attribute Enum flags classifying this Request

View Source​
Declaration
RequestAttributes RequestAttributes { get; set; }

RequestPreferences​

Optional preferences for the processing of this Request

View Source​
Declaration
IRequestPreferences RequestPreferences { get; }

Dto​

The Request DTO, after it has been deserialized.

View Source​
Declaration
object Dto { get; set; }

ContentType​

The request ContentType

View Source​
Declaration
string ContentType { get; }

IsLocal​

Whether this was an Internal Request

View Source​
Declaration
bool IsLocal { get; }

UserAgent​

The UserAgent for the request

View Source​
Declaration
string UserAgent { get; }

Cookies​

A Dictionary of HTTP Cookies sent with this Request

View Source​
Declaration
IDictionary<string, Cookie> Cookies { get; }

ResponseContentType​

The expected Response ContentType for this request

View Source​
Declaration
string ResponseContentType { get; set; }

HasExplicitResponseContentType​

Whether the ResponseContentType has been explicitly overridden or whether it was just the default

View Source​
Declaration
bool HasExplicitResponseContentType { get; }

Items​

Attach any data to this request that all filters and services can access.

View Source​
Declaration
Dictionary<string, object> Items { get; }

Headers​

The HTTP Headers in a NameValueCollection

View Source​
Declaration
NameValueCollection Headers { get; }

QueryString​

The ?query=string in a NameValueCollection

View Source​
Declaration
NameValueCollection QueryString { get; }

FormData​

The HTTP POST'ed Form Data in a NameValueCollection

View Source​
Declaration
NameValueCollection FormData { get; }

UseBufferedStream​

Buffer the Request InputStream so it can be re-read

View Source​
Declaration
bool UseBufferedStream { get; set; }

RawUrl​

Relative URL containing /path/info?query=string

View Source​
Declaration
string RawUrl { get; }

AbsoluteUri​

The Absolute URL for the request

View Source​
Declaration
string AbsoluteUri { get; }

UserHostAddress​

The Remote IP as reported by Request.UserHostAddress

View Source​
Declaration
string UserHostAddress { get; }

RemoteIp​

The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress

View Source​
Declaration
string RemoteIp { get; }

Authorization​

The value of the Authorization Header used to send the Api Key, null if not available

View Source​
Declaration
string Authorization { get; }

IsSecureConnection​

e.g. is https or not

View Source​
Declaration
bool IsSecureConnection { get; }

AcceptTypes​

Array of different Content-Types accepted by the client

View Source​
Declaration
string[] AcceptTypes { get; }

PathInfo​

The normalized /path/info for the request

View Source​
Declaration
string PathInfo { get; }

OriginalPathInfo​

The original /path/info as sent

View Source​
Declaration
string OriginalPathInfo { get; }

InputStream​

The Request Body Input Stream

View Source​
Declaration
Stream InputStream { get; }

ContentLength​

The size of the Request Body if provided

View Source​
Declaration
long ContentLength { get; }

Files​

Access to the multi-part/formdata files posted on this request

View Source​
Declaration
IHttpFile[] Files { get; }

UrlReferrer​

The value of the Referrer, null if not available

View Source​
Declaration
Uri UrlReferrer { get; }

Methods​

GetRawBody()​

The entire string contents of Request.InputStream

View Source​
Declaration
string GetRawBody()
Returns​

System.String

GetRawBodyAsync()​

The entire string contents of Request.InputStream async

View Source​
Declaration
Task<string> GetRawBodyAsync()
Returns​

System.Threading.Tasks.Task<System.String>