HttpResponseExtensionsInternal
Assembly: ServiceStack.dll
View Source
public static class HttpResponseExtensionsInternal
Methods
WriteToOutputStream(IResponse, Object, Byte[], Byte[])
View Source
[Obsolete("Use WriteToOutputStreamAsync")]
public static bool WriteToOutputStream(IResponse response, object result, byte[] bodyPrefix, byte[] bodySuffix)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | response |
System.Object | result |
System.Byte[] | bodyPrefix |
System.Byte[] | bodySuffix |
WriteToOutputStreamAsync(IResponse, Object, Byte[], Byte[], CancellationToken)
View Source
public static async Task<bool> WriteToOutputStreamAsync(IResponse response, object result, byte[] bodyPrefix, byte[] bodySuffix, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | response |
System.Object | result |
System.Byte[] | bodyPrefix |
System.Byte[] | bodySuffix |
System.Threading.CancellationToken | token |
WriteToResponse(IResponse, Object, String, CancellationToken)
View Source
public static Task<bool> WriteToResponse(this IResponse httpRes, object result, string contentType, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
System.Object | result |
System.String | contentType |
System.Threading.CancellationToken | token |
WriteToResponse(IResponse, IRequest, Object, CancellationToken)
View Source
public static Task<bool> WriteToResponse(this IResponse httpRes, IRequest httpReq, object result, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
ServiceStack.Web.IRequest | httpReq |
System.Object | result |
System.Threading.CancellationToken | token |
WriteToResponse(IResponse, IRequest, Object, Byte[], Byte[], CancellationToken)
View Source
public static Task<bool> WriteToResponse(this IResponse httpRes, IRequest httpReq, object result, byte[] bodyPrefix, byte[] bodySuffix, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
ServiceStack.Web.IRequest | httpReq |
System.Object | result |
System.Byte[] | bodyPrefix |
System.Byte[] | bodySuffix |
System.Threading.CancellationToken | token |
WriteToResponse(IResponse, Object, StreamSerializerDelegateAsync, IRequest, CancellationToken)
View Source
public static Task<bool> WriteToResponse(this IResponse httpRes, object result, StreamSerializerDelegateAsync serializer, IRequest serializationContext, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
System.Object | result |
ServiceStack.Web.StreamSerializerDelegateAsync | serializer |
ServiceStack.Web.IRequest | serializationContext |
System.Threading.CancellationToken | token |
WriteToResponse(IResponse, Object, StreamSerializerDelegateAsync, IRequest, Byte[], Byte[], CancellationToken)
Writes to response. Response headers are customizable by implementing IHasOptions an returning Dictionary of Http headers.
View Source
public static async Task<bool> WriteToResponse(this IResponse response, object result, StreamSerializerDelegateAsync defaultAction, IRequest request, byte[] bodyPrefix, byte[] bodySuffix, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.Web.IResponse | response | The response. |
|
| System.Object
| result | Whether or not it was implicitly handled by ServiceStack's built-in handlers.
| | ServiceStack.Web.StreamSerializerDelegateAsync | defaultAction | The default action.
| | ServiceStack.Web.IRequest | request | The serialization context.
|
| System.Byte[]
| bodyPrefix | Add prefix to response body if any
|
| System.Byte[]
| bodySuffix | Add suffix to response body if any
|
| System.Threading.CancellationToken
| token |
|
WriteBytesToResponse(IResponse, Byte[], String, CancellationToken)
View Source
public static async Task WriteBytesToResponse(this IResponse res, byte[] responseBytes, string contentType, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | res |
System.Byte[] | responseBytes |
System.String | contentType |
System.Threading.CancellationToken | token |
WriteError(IResponse, IRequest, Object, String)
View Source
public static Task WriteError(this IResponse httpRes, IRequest httpReq, object dto, string errorMessage)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
ServiceStack.Web.IRequest | httpReq |
System.Object | dto |
System.String | errorMessage |
WriteError(IResponse, Object, String)
View Source
public static Task WriteError(this IResponse httpRes, object dto, string errorMessage)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
System.Object | dto |
System.String | errorMessage |
WriteError(IResponse, Exception, Int32, String, String)
View Source
public static Task WriteError(this IResponse httpRes, Exception ex, int statusCode = 500, string errorMessage = null, string contentType = null)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
System.Exception | ex |
System.Int32 | statusCode |
System.String | errorMessage |
System.String | contentType |
WriteErrorBody(IResponse, Exception)
When HTTP Headers have already been written and only the Body can be written
View Source
public static Task WriteErrorBody(this IResponse httpRes, Exception ex)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
System.Exception | ex |
WriteErrorToResponse(IResponse, IRequest, String, String, String, Exception, Int32)
View Source
public static async Task WriteErrorToResponse(this IResponse httpRes, IRequest httpReq, string contentType, string operationName, string errorMessage, Exception ex, int statusCode)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
ServiceStack.Web.IRequest | httpReq |
System.String | contentType |
System.String | operationName |
System.String | errorMessage |
System.Exception | ex |
System.Int32 | statusCode |
ShouldWriteGlobalHeaders(IResponse)
View Source
public static bool ShouldWriteGlobalHeaders(IResponse httpRes)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
ApplyGlobalResponseHeaders(HttpListenerResponse)
View Source
public static void ApplyGlobalResponseHeaders(this HttpListenerResponse httpRes)
Parameters
Type | Name |
---|---|
System.Net.HttpListenerResponse | httpRes |
ApplyGlobalResponseHeaders(HttpResponseBase)
View Source
public static void ApplyGlobalResponseHeaders(this HttpResponseBase httpRes)
Parameters
Type | Name |
---|---|
System.Web.HttpResponseBase | httpRes |
ApplyGlobalResponseHeaders(IResponse)
View Source
public static void ApplyGlobalResponseHeaders(this IResponse httpRes)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |