HttpResultUtils
Assembly: ServiceStack.dll
View Source
Declaration
public static class HttpResultUtils
Methods
GetDto(Object)
Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult
View Source
Declaration
public static object GetDto(this object response)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | response |
GetResponseDto(Object)
Alias of AsDto
View Source
Declaration
public static object GetResponseDto(this object response)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | response |
GetDto<TResponse>(Object)
Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult
View Source
Declaration
public static TResponse GetDto<TResponse>(this object response)
where TResponse : class
Returns
<TResponse>
: TResponse if found; otherwise null
Parameters
Type | Name |
---|---|
System.Object | response |
Type Parameters
TResponse
GetResponseDto<TResponse>(Object)
Alias of AsDto
View Source
Declaration
public static TResponse GetResponseDto<TResponse>(this object response)
where TResponse : class
Returns
<TResponse>
Parameters
Type | Name |
---|---|
System.Object | response |
Type Parameters
TResponse
CreateErrorResponse(IHttpError)
View Source
Declaration
public static object CreateErrorResponse(this IHttpError httpError)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpError | httpError |
IsErrorResponse(Object)
Whether the response is an IHttpError or Exception or ErrorResponse
View Source
Declaration
public static bool IsErrorResponse(this object response)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Object | response |
ExtractHttpRanges(String, Int64, out Int64, out Int64)
rangeHeader should be of the format "bytes=0-" or "bytes=0-12345" or "bytes=123-456"
View Source
Declaration
public static void ExtractHttpRanges(this string rangeHeader, long contentLength, out long rangeStart, out long rangeEnd)
Parameters
Type | Name |
---|---|
System.String | rangeHeader |
System.Int64 | contentLength |
System.Int64 | rangeStart |
System.Int64 | rangeEnd |
AddHttpRangeResponseHeaders(IResponse, Int64, Int64, Int64)
Adds 206 PartialContent Status, Content-Range and Content-Length headers
View Source
Declaration
public static void AddHttpRangeResponseHeaders(this IResponse response, long rangeStart, long rangeEnd, long contentLength)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | response |
System.Int64 | rangeStart |
System.Int64 | rangeEnd |
System.Int64 | contentLength |