C# Class ServiceStack.HttpRequestExtensions

Afficher le fichier Open project: ServiceStack/ServiceStack Class Usage Examples

Méthodes publiques

Méthode Description
CookiesAsDictionary ( this httpReq ) : string>.Dictionary
DidReturn304NotModified ( this httpReq, System.DateTime dateTime, IResponse httpRes ) : bool
GetAbsolutePath ( this httpReq ) : string
GetAbsoluteUrl ( this httpReq, string url ) : string
GetApplicationUrl ( this httpReq ) : string
GetAttributes ( IPAddress ipAddress ) : ServiceStack.Host.RequestAttributes
GetAttributes ( this request ) : ServiceStack.Host.RequestAttributes
GetBaseUrl ( this request ) : string
GetDirectoryPath ( this request ) : string
GetFlattenedRequestParams ( this request ) : string>.Dictionary

Duplicate params have their values joined together in a comma-delimited string

GetFormatModifier ( this httpReq ) : string
GetHttpMethodOverride ( this httpReq ) : string
GetItemOrCookie ( this httpReq, string name ) : string

Gets string value from Items[name] then Cookies[name] if exists. Useful when *first* setting the users response cookie in the request filter. To access the value for this initial request you need to set it in Items[].

GetJsonpCallback ( this httpReq ) : string
GetLastPathInfo ( this request ) : string
GetLeftAuthority ( this uri ) : string
GetOperationName ( this request ) : string
GetOperationNameFromLastPathInfo ( string lastPathInfo ) : string
GetOperationType ( this req ) : Type
GetParam ( this httpReq, string name ) : string

Gets request paramater string value by looking in the following order: - QueryString[name] - FormData[name] - Cookies[name] - Items[name]

GetParentAbsolutePath ( this httpReq ) : string
GetParentBaseUrl ( this request ) : string
GetParentPathUrl ( this httpReq ) : string
GetPathAndQuery ( this request ) : string
GetPathInfo ( string fullPath, string mode, string appPath ) : string
GetPathInfo ( this request ) : string
GetPathUrl ( this httpReq ) : string
GetPhysicalPath ( this httpReq ) : string
GetQueryStringContentType ( this httpReq ) : string
GetRequestParams ( this request ) : string>.Dictionary

Duplicate Params are given a unique key by appending a #1 suffix

GetResponseContentType ( this httpReq ) : string
GetRoute ( this req ) : RestPath
GetSoapMessage ( this httpReq ) : System.ServiceModel.Channels.Message
GetTemplate ( this httpReq ) : string
GetUrlHostName ( this httpReq ) : string
GetView ( this httpReq ) : string
GetVirtualDirectory ( this httpReq ) : IVirtualDirectory
GetVirtualFile ( this httpReq ) : IVirtualFile
GetVirtualNode ( this httpReq ) : IVirtualNode
HasAnyOfContentTypes ( this request ) : bool
HasNotModifiedSince ( this httpReq, System.DateTime dateTime ) : bool
InferBaseUrl ( this absoluteUri, string fromPathInfo = null ) : string
IsContentType ( this request, string contentType ) : bool
IsInLocalSubnet ( this ipAddress ) : bool
IsMultiRequest ( this req ) : bool
NormalizeScheme ( this url, bool useHttps ) : string
ResolveAbsoluteUrl ( this httpReq, string url ) : string
ResolveItem ( this httpReq, string itemKey, object>.Func resolveFn ) : object

Use this to treat Request.Items[] as a cache by returning pre-computed items to save calculating them multiple times.

ResolvePathInfoFromMappedPath ( string fullPath, string mappedPathRoot ) : string
SanitizedVirtualPath ( this virtualPath ) : string
SetAutoBatchCompletedHeader ( this req, int completed ) : void
SetOperationName ( this httpReq, string operationName ) : void
SetRoute ( this req, RestPath route ) : void
SetTemplate ( this httpReq, string templateName ) : void
SetView ( this httpReq, string viewName ) : void
ToErrorCode ( this ex ) : string
ToHttpContextBase ( this aspnetHttpReq ) : System.Web.HttpContextBase
ToRequest ( this httpCtx, string operationName = null ) : IHttpRequest
ToRequestAttributes ( string attrNames ) : ServiceStack.Host.RequestAttributes
ToResponse ( this httpCtx ) : IHttpResponse
ToStatusCode ( this ex ) : int
ToWebServiceException ( this error ) : ServiceStack.WebServiceException
UseHttps ( this httpReq ) : bool

Private Methods

Méthode Description
GetLastPathInfoFromRawUrl ( string rawUrl ) : string
HttpRequestExtensions ( ) : System

Method Details

CookiesAsDictionary() public static méthode

public static CookiesAsDictionary ( this httpReq ) : string>.Dictionary
httpReq this
Résultat string>.Dictionary

DidReturn304NotModified() public static méthode

public static DidReturn304NotModified ( this httpReq, System.DateTime dateTime, IResponse httpRes ) : bool
httpReq this
dateTime System.DateTime
httpRes IResponse
Résultat bool

GetAbsolutePath() public static méthode

public static GetAbsolutePath ( this httpReq ) : string
httpReq this
Résultat string

GetAbsoluteUrl() public static méthode

public static GetAbsoluteUrl ( this httpReq, string url ) : string
httpReq this
url string
Résultat string

GetApplicationUrl() public static méthode

public static GetApplicationUrl ( this httpReq ) : string
httpReq this
Résultat string

GetAttributes() public static méthode

public static GetAttributes ( IPAddress ipAddress ) : ServiceStack.Host.RequestAttributes
ipAddress System.Net.IPAddress
Résultat ServiceStack.Host.RequestAttributes

GetAttributes() public static méthode

public static GetAttributes ( this request ) : ServiceStack.Host.RequestAttributes
request this
Résultat ServiceStack.Host.RequestAttributes

GetBaseUrl() public static méthode

public static GetBaseUrl ( this request ) : string
request this
Résultat string

GetDirectoryPath() public static méthode

public static GetDirectoryPath ( this request ) : string
request this
Résultat string

GetFlattenedRequestParams() public static méthode

Duplicate params have their values joined together in a comma-delimited string
public static GetFlattenedRequestParams ( this request ) : string>.Dictionary
request this
Résultat string>.Dictionary

GetFormatModifier() public static méthode

public static GetFormatModifier ( this httpReq ) : string
httpReq this
Résultat string

GetHttpMethodOverride() public static méthode

public static GetHttpMethodOverride ( this httpReq ) : string
httpReq this
Résultat string

GetItemOrCookie() public static méthode

Gets string value from Items[name] then Cookies[name] if exists. Useful when *first* setting the users response cookie in the request filter. To access the value for this initial request you need to set it in Items[].
public static GetItemOrCookie ( this httpReq, string name ) : string
httpReq this
name string
Résultat string

GetJsonpCallback() public static méthode

public static GetJsonpCallback ( this httpReq ) : string
httpReq this
Résultat string

GetLastPathInfo() public static méthode

public static GetLastPathInfo ( this request ) : string
request this
Résultat string

GetLeftAuthority() public static méthode

public static GetLeftAuthority ( this uri ) : string
uri this
Résultat string

GetOperationName() public static méthode

public static GetOperationName ( this request ) : string
request this
Résultat string

GetOperationNameFromLastPathInfo() public static méthode

public static GetOperationNameFromLastPathInfo ( string lastPathInfo ) : string
lastPathInfo string
Résultat string

GetOperationType() public static méthode

public static GetOperationType ( this req ) : Type
req this
Résultat System.Type

GetParam() public static méthode

Gets request paramater string value by looking in the following order: - QueryString[name] - FormData[name] - Cookies[name] - Items[name]
public static GetParam ( this httpReq, string name ) : string
httpReq this
name string
Résultat string

GetParentAbsolutePath() public static méthode

public static GetParentAbsolutePath ( this httpReq ) : string
httpReq this
Résultat string

GetParentBaseUrl() public static méthode

public static GetParentBaseUrl ( this request ) : string
request this
Résultat string

GetParentPathUrl() public static méthode

public static GetParentPathUrl ( this httpReq ) : string
httpReq this
Résultat string

GetPathAndQuery() public static méthode

public static GetPathAndQuery ( this request ) : string
request this
Résultat string

GetPathInfo() public static méthode

public static GetPathInfo ( string fullPath, string mode, string appPath ) : string
fullPath string
mode string
appPath string
Résultat string

GetPathInfo() public static méthode

public static GetPathInfo ( this request ) : string
request this
Résultat string

GetPathUrl() public static méthode

public static GetPathUrl ( this httpReq ) : string
httpReq this
Résultat string

GetPhysicalPath() public static méthode

public static GetPhysicalPath ( this httpReq ) : string
httpReq this
Résultat string

GetQueryStringContentType() public static méthode

public static GetQueryStringContentType ( this httpReq ) : string
httpReq this
Résultat string

GetRequestParams() public static méthode

Duplicate Params are given a unique key by appending a #1 suffix
public static GetRequestParams ( this request ) : string>.Dictionary
request this
Résultat string>.Dictionary

GetResponseContentType() public static méthode

public static GetResponseContentType ( this httpReq ) : string
httpReq this
Résultat string

GetRoute() public static méthode

public static GetRoute ( this req ) : RestPath
req this
Résultat ServiceStack.Host.RestPath

GetSoapMessage() public static méthode

public static GetSoapMessage ( this httpReq ) : System.ServiceModel.Channels.Message
httpReq this
Résultat System.ServiceModel.Channels.Message

GetTemplate() public static méthode

public static GetTemplate ( this httpReq ) : string
httpReq this
Résultat string

GetUrlHostName() public static méthode

public static GetUrlHostName ( this httpReq ) : string
httpReq this
Résultat string

GetView() public static méthode

public static GetView ( this httpReq ) : string
httpReq this
Résultat string

GetVirtualDirectory() public static méthode

public static GetVirtualDirectory ( this httpReq ) : IVirtualDirectory
httpReq this
Résultat IVirtualDirectory

GetVirtualFile() public static méthode

public static GetVirtualFile ( this httpReq ) : IVirtualFile
httpReq this
Résultat IVirtualFile

GetVirtualNode() public static méthode

public static GetVirtualNode ( this httpReq ) : IVirtualNode
httpReq this
Résultat IVirtualNode

HasAnyOfContentTypes() public static méthode

public static HasAnyOfContentTypes ( this request ) : bool
request this
Résultat bool

HasNotModifiedSince() public static méthode

public static HasNotModifiedSince ( this httpReq, System.DateTime dateTime ) : bool
httpReq this
dateTime System.DateTime
Résultat bool

InferBaseUrl() public static méthode

public static InferBaseUrl ( this absoluteUri, string fromPathInfo = null ) : string
absoluteUri this
fromPathInfo string
Résultat string

IsContentType() public static méthode

public static IsContentType ( this request, string contentType ) : bool
request this
contentType string
Résultat bool

IsInLocalSubnet() public static méthode

public static IsInLocalSubnet ( this ipAddress ) : bool
ipAddress this
Résultat bool

IsMultiRequest() public static méthode

public static IsMultiRequest ( this req ) : bool
req this
Résultat bool

NormalizeScheme() public static méthode

public static NormalizeScheme ( this url, bool useHttps ) : string
url this
useHttps bool
Résultat string

ResolveAbsoluteUrl() public static méthode

public static ResolveAbsoluteUrl ( this httpReq, string url ) : string
httpReq this
url string
Résultat string

ResolveItem() public static méthode

Use this to treat Request.Items[] as a cache by returning pre-computed items to save calculating them multiple times.
public static ResolveItem ( this httpReq, string itemKey, object>.Func resolveFn ) : object
httpReq this
itemKey string
resolveFn object>.Func
Résultat object

ResolvePathInfoFromMappedPath() public static méthode

public static ResolvePathInfoFromMappedPath ( string fullPath, string mappedPathRoot ) : string
fullPath string
mappedPathRoot string
Résultat string

SanitizedVirtualPath() public static méthode

public static SanitizedVirtualPath ( this virtualPath ) : string
virtualPath this
Résultat string

SetAutoBatchCompletedHeader() public static méthode

public static SetAutoBatchCompletedHeader ( this req, int completed ) : void
req this
completed int
Résultat void

SetOperationName() public static méthode

public static SetOperationName ( this httpReq, string operationName ) : void
httpReq this
operationName string
Résultat void

SetRoute() public static méthode

public static SetRoute ( this req, RestPath route ) : void
req this
route ServiceStack.Host.RestPath
Résultat void

SetTemplate() public static méthode

public static SetTemplate ( this httpReq, string templateName ) : void
httpReq this
templateName string
Résultat void

SetView() public static méthode

public static SetView ( this httpReq, string viewName ) : void
httpReq this
viewName string
Résultat void

ToErrorCode() public static méthode

public static ToErrorCode ( this ex ) : string
ex this
Résultat string

ToHttpContextBase() public static méthode

public static ToHttpContextBase ( this aspnetHttpReq ) : System.Web.HttpContextBase
aspnetHttpReq this
Résultat System.Web.HttpContextBase

ToRequest() public static méthode

public static ToRequest ( this httpCtx, string operationName = null ) : IHttpRequest
httpCtx this
operationName string
Résultat IHttpRequest

ToRequestAttributes() public static méthode

public static ToRequestAttributes ( string attrNames ) : ServiceStack.Host.RequestAttributes
attrNames string
Résultat ServiceStack.Host.RequestAttributes

ToResponse() public static méthode

public static ToResponse ( this httpCtx ) : IHttpResponse
httpCtx this
Résultat IHttpResponse

ToStatusCode() public static méthode

public static ToStatusCode ( this ex ) : int
ex this
Résultat int

ToWebServiceException() public static méthode

public static ToWebServiceException ( this error ) : ServiceStack.WebServiceException
error this
Résultat ServiceStack.WebServiceException

UseHttps() public static méthode

public static UseHttps ( this httpReq ) : bool
httpReq this
Résultat bool