Skip to main content

HttpResponseExtensionsInternal

Assembly: ServiceStack.dll
View Source
Declaration
public static class HttpResponseExtensionsInternal

Methods

WriteToOutputStream(IResponse, Object, Byte[], Byte[])

View Source
Declaration
[Obsolete("Use WriteToOutputStreamAsync")]
public static bool WriteToOutputStream(IResponse response, object result, byte[] bodyPrefix, byte[] bodySuffix)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Web.IResponseresponse
System.Objectresult
System.Byte[]bodyPrefix
System.Byte[]bodySuffix

WriteToOutputStreamAsync(IResponse, Object, Byte[], Byte[], CancellationToken)

View Source
Declaration
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
TypeName
ServiceStack.Web.IResponseresponse
System.Objectresult
System.Byte[]bodyPrefix
System.Byte[]bodySuffix
System.Threading.CancellationTokentoken

WriteToResponse(IResponse, Object, String, CancellationToken)

View Source
Declaration
public static Task<bool> WriteToResponse(this IResponse httpRes, object result, string contentType, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
System.Objectresult
System.StringcontentType
System.Threading.CancellationTokentoken

WriteToResponse(IResponse, IRequest, Object, CancellationToken)

View Source
Declaration
public static Task<bool> WriteToResponse(this IResponse httpRes, IRequest httpReq, object result, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
ServiceStack.Web.IRequesthttpReq
System.Objectresult
System.Threading.CancellationTokentoken

WriteToResponse(IResponse, IRequest, Object, Byte[], Byte[], CancellationToken)

View Source
Declaration
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
TypeName
ServiceStack.Web.IResponsehttpRes
ServiceStack.Web.IRequesthttpReq
System.Objectresult
System.Byte[]bodyPrefix
System.Byte[]bodySuffix
System.Threading.CancellationTokentoken

WriteToResponse(IResponse, Object, StreamSerializerDelegateAsync, IRequest, CancellationToken)

View Source
Declaration
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
TypeName
ServiceStack.Web.IResponsehttpRes
System.Objectresult
ServiceStack.Web.StreamSerializerDelegateAsyncserializer
ServiceStack.Web.IRequestserializationContext
System.Threading.CancellationTokentoken

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
Declaration
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
TypeNameDescription
ServiceStack.Web.IResponseresponseThe 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
Declaration
public static async Task WriteBytesToResponse(this IResponse res, byte[] responseBytes, string contentType, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IResponseres
System.Byte[]responseBytes
System.StringcontentType
System.Threading.CancellationTokentoken

WriteError(IResponse, IRequest, Object, String)

View Source
Declaration
public static Task WriteError(this IResponse httpRes, IRequest httpReq, object dto, string errorMessage)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
ServiceStack.Web.IRequesthttpReq
System.Objectdto
System.StringerrorMessage

WriteError(IResponse, Object, String)

View Source
Declaration
public static Task WriteError(this IResponse httpRes, object dto, string errorMessage)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
System.Objectdto
System.StringerrorMessage

WriteError(IResponse, Exception, Int32, String, String)

View Source
Declaration
public static Task WriteError(this IResponse httpRes, Exception ex, int statusCode = 500, string errorMessage = null, string contentType = null)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
System.Exceptionex
System.Int32statusCode
System.StringerrorMessage
System.StringcontentType

WriteErrorBody(IResponse, Exception)

When HTTP Headers have already been written and only the Body can be written

View Source
Declaration
public static Task WriteErrorBody(this IResponse httpRes, Exception ex)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
System.Exceptionex

WriteErrorToResponse(IResponse, IRequest, String, String, String, Exception, Int32)

View Source
Declaration
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
TypeName
ServiceStack.Web.IResponsehttpRes
ServiceStack.Web.IRequesthttpReq
System.StringcontentType
System.StringoperationName
System.StringerrorMessage
System.Exceptionex
System.Int32statusCode

ShouldWriteGlobalHeaders(IResponse)

View Source
Declaration
public static bool ShouldWriteGlobalHeaders(IResponse httpRes)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes

ApplyGlobalResponseHeaders(HttpListenerResponse)

View Source
Declaration
public static void ApplyGlobalResponseHeaders(this HttpListenerResponse httpRes)
Parameters
TypeName
System.Net.HttpListenerResponsehttpRes

ApplyGlobalResponseHeaders(HttpResponseBase)

View Source
Declaration
public static void ApplyGlobalResponseHeaders(this HttpResponseBase httpRes)
Parameters
TypeName
System.Web.HttpResponseBasehttpRes

ApplyGlobalResponseHeaders(IResponse)

View Source
Declaration
public static void ApplyGlobalResponseHeaders(this IResponse httpRes)
Parameters
TypeName
ServiceStack.Web.IResponsehttpRes