C# Класс ServiceStack.HttpRequestExtensions

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
GetLastPathInfoFromRawUrl ( string rawUrl ) : string
HttpRequestExtensions ( ) : System

Описание методов

CookiesAsDictionary() публичный статический Метод

public static CookiesAsDictionary ( this httpReq ) : string>.Dictionary
httpReq this
Результат string>.Dictionary

DidReturn304NotModified() публичный статический Метод

public static DidReturn304NotModified ( this httpReq, System.DateTime dateTime, IResponse httpRes ) : bool
httpReq this
dateTime System.DateTime
httpRes IResponse
Результат bool

GetAbsolutePath() публичный статический Метод

public static GetAbsolutePath ( this httpReq ) : string
httpReq this
Результат string

GetAbsoluteUrl() публичный статический Метод

public static GetAbsoluteUrl ( this httpReq, string url ) : string
httpReq this
url string
Результат string

GetApplicationUrl() публичный статический Метод

public static GetApplicationUrl ( this httpReq ) : string
httpReq this
Результат string

GetAttributes() публичный статический Метод

public static GetAttributes ( IPAddress ipAddress ) : ServiceStack.Host.RequestAttributes
ipAddress System.Net.IPAddress
Результат ServiceStack.Host.RequestAttributes

GetAttributes() публичный статический Метод

public static GetAttributes ( this request ) : ServiceStack.Host.RequestAttributes
request this
Результат ServiceStack.Host.RequestAttributes

GetBaseUrl() публичный статический Метод

public static GetBaseUrl ( this request ) : string
request this
Результат string

GetDirectoryPath() публичный статический Метод

public static GetDirectoryPath ( this request ) : string
request this
Результат string

GetFlattenedRequestParams() публичный статический Метод

Duplicate params have their values joined together in a comma-delimited string
public static GetFlattenedRequestParams ( this request ) : string>.Dictionary
request this
Результат string>.Dictionary

GetFormatModifier() публичный статический Метод

public static GetFormatModifier ( this httpReq ) : string
httpReq this
Результат string

GetHttpMethodOverride() публичный статический Метод

public static GetHttpMethodOverride ( this httpReq ) : string
httpReq this
Результат string

GetItemOrCookie() публичный статический Метод

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
Результат string

GetJsonpCallback() публичный статический Метод

public static GetJsonpCallback ( this httpReq ) : string
httpReq this
Результат string

GetLastPathInfo() публичный статический Метод

public static GetLastPathInfo ( this request ) : string
request this
Результат string

GetLeftAuthority() публичный статический Метод

public static GetLeftAuthority ( this uri ) : string
uri this
Результат string

GetOperationName() публичный статический Метод

public static GetOperationName ( this request ) : string
request this
Результат string

GetOperationNameFromLastPathInfo() публичный статический Метод

public static GetOperationNameFromLastPathInfo ( string lastPathInfo ) : string
lastPathInfo string
Результат string

GetOperationType() публичный статический Метод

public static GetOperationType ( this req ) : Type
req this
Результат System.Type

GetParam() публичный статический Метод

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
Результат string

GetParentAbsolutePath() публичный статический Метод

public static GetParentAbsolutePath ( this httpReq ) : string
httpReq this
Результат string

GetParentBaseUrl() публичный статический Метод

public static GetParentBaseUrl ( this request ) : string
request this
Результат string

GetParentPathUrl() публичный статический Метод

public static GetParentPathUrl ( this httpReq ) : string
httpReq this
Результат string

GetPathAndQuery() публичный статический Метод

public static GetPathAndQuery ( this request ) : string
request this
Результат string

GetPathInfo() публичный статический Метод

public static GetPathInfo ( string fullPath, string mode, string appPath ) : string
fullPath string
mode string
appPath string
Результат string

GetPathInfo() публичный статический Метод

public static GetPathInfo ( this request ) : string
request this
Результат string

GetPathUrl() публичный статический Метод

public static GetPathUrl ( this httpReq ) : string
httpReq this
Результат string

GetPhysicalPath() публичный статический Метод

public static GetPhysicalPath ( this httpReq ) : string
httpReq this
Результат string

GetQueryStringContentType() публичный статический Метод

public static GetQueryStringContentType ( this httpReq ) : string
httpReq this
Результат string

GetRequestParams() публичный статический Метод

Duplicate Params are given a unique key by appending a #1 suffix
public static GetRequestParams ( this request ) : string>.Dictionary
request this
Результат string>.Dictionary

GetResponseContentType() публичный статический Метод

public static GetResponseContentType ( this httpReq ) : string
httpReq this
Результат string

GetRoute() публичный статический Метод

public static GetRoute ( this req ) : RestPath
req this
Результат ServiceStack.Host.RestPath

GetSoapMessage() публичный статический Метод

public static GetSoapMessage ( this httpReq ) : System.ServiceModel.Channels.Message
httpReq this
Результат System.ServiceModel.Channels.Message

GetTemplate() публичный статический Метод

public static GetTemplate ( this httpReq ) : string
httpReq this
Результат string

GetUrlHostName() публичный статический Метод

public static GetUrlHostName ( this httpReq ) : string
httpReq this
Результат string

GetView() публичный статический Метод

public static GetView ( this httpReq ) : string
httpReq this
Результат string

GetVirtualDirectory() публичный статический Метод

public static GetVirtualDirectory ( this httpReq ) : IVirtualDirectory
httpReq this
Результат IVirtualDirectory

GetVirtualFile() публичный статический Метод

public static GetVirtualFile ( this httpReq ) : IVirtualFile
httpReq this
Результат IVirtualFile

GetVirtualNode() публичный статический Метод

public static GetVirtualNode ( this httpReq ) : IVirtualNode
httpReq this
Результат IVirtualNode

HasAnyOfContentTypes() публичный статический Метод

public static HasAnyOfContentTypes ( this request ) : bool
request this
Результат bool

HasNotModifiedSince() публичный статический Метод

public static HasNotModifiedSince ( this httpReq, System.DateTime dateTime ) : bool
httpReq this
dateTime System.DateTime
Результат bool

InferBaseUrl() публичный статический Метод

public static InferBaseUrl ( this absoluteUri, string fromPathInfo = null ) : string
absoluteUri this
fromPathInfo string
Результат string

IsContentType() публичный статический Метод

public static IsContentType ( this request, string contentType ) : bool
request this
contentType string
Результат bool

IsInLocalSubnet() публичный статический Метод

public static IsInLocalSubnet ( this ipAddress ) : bool
ipAddress this
Результат bool

IsMultiRequest() публичный статический Метод

public static IsMultiRequest ( this req ) : bool
req this
Результат bool

NormalizeScheme() публичный статический Метод

public static NormalizeScheme ( this url, bool useHttps ) : string
url this
useHttps bool
Результат string

ResolveAbsoluteUrl() публичный статический Метод

public static ResolveAbsoluteUrl ( this httpReq, string url ) : string
httpReq this
url string
Результат string

ResolveItem() публичный статический Метод

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
Результат object

ResolvePathInfoFromMappedPath() публичный статический Метод

public static ResolvePathInfoFromMappedPath ( string fullPath, string mappedPathRoot ) : string
fullPath string
mappedPathRoot string
Результат string

SanitizedVirtualPath() публичный статический Метод

public static SanitizedVirtualPath ( this virtualPath ) : string
virtualPath this
Результат string

SetAutoBatchCompletedHeader() публичный статический Метод

public static SetAutoBatchCompletedHeader ( this req, int completed ) : void
req this
completed int
Результат void

SetOperationName() публичный статический Метод

public static SetOperationName ( this httpReq, string operationName ) : void
httpReq this
operationName string
Результат void

SetRoute() публичный статический Метод

public static SetRoute ( this req, RestPath route ) : void
req this
route ServiceStack.Host.RestPath
Результат void

SetTemplate() публичный статический Метод

public static SetTemplate ( this httpReq, string templateName ) : void
httpReq this
templateName string
Результат void

SetView() публичный статический Метод

public static SetView ( this httpReq, string viewName ) : void
httpReq this
viewName string
Результат void

ToErrorCode() публичный статический Метод

public static ToErrorCode ( this ex ) : string
ex this
Результат string

ToHttpContextBase() публичный статический Метод

public static ToHttpContextBase ( this aspnetHttpReq ) : System.Web.HttpContextBase
aspnetHttpReq this
Результат System.Web.HttpContextBase

ToRequest() публичный статический Метод

public static ToRequest ( this httpCtx, string operationName = null ) : IHttpRequest
httpCtx this
operationName string
Результат IHttpRequest

ToRequestAttributes() публичный статический Метод

public static ToRequestAttributes ( string attrNames ) : ServiceStack.Host.RequestAttributes
attrNames string
Результат ServiceStack.Host.RequestAttributes

ToResponse() публичный статический Метод

public static ToResponse ( this httpCtx ) : IHttpResponse
httpCtx this
Результат IHttpResponse

ToStatusCode() публичный статический Метод

public static ToStatusCode ( this ex ) : int
ex this
Результат int

ToWebServiceException() публичный статический Метод

public static ToWebServiceException ( this error ) : ServiceStack.WebServiceException
error this
Результат ServiceStack.WebServiceException

UseHttps() публичный статический Метод

public static UseHttps ( this httpReq ) : bool
httpReq this
Результат bool