C# Class ServiceStack.HttpResult

Inheritance: IHttpResult, IStreamWriter, IPartialWriter
Mostrar archivo Open project: ServiceStack/ServiceStack Class Usage Examples

Public Methods

Method Description
DeleteCookie ( string name ) : void
GetContentLength ( ) : long?
HttpResult ( ) : System
HttpResult ( FileInfo fileResponse, bool asAttachment ) : System
HttpResult ( FileInfo fileResponse, string contentType = null, bool asAttachment = false ) : System
HttpResult ( HttpStatusCode statusCode, string statusDescription ) : System
HttpResult ( IVirtualFile fileResponse, bool asAttachment ) : System
HttpResult ( IVirtualFile fileResponse, string contentType = null, bool asAttachment = false ) : System
HttpResult ( Stream responseStream, string contentType ) : System
HttpResult ( byte responseBytes, string contentType ) : System
HttpResult ( object response ) : System
HttpResult ( object response, HttpStatusCode statusCode ) : System
HttpResult ( object response, string contentType ) : System
HttpResult ( object response, string contentType, HttpStatusCode statusCode ) : System
HttpResult ( string responseText, string contentType ) : System
NotModified ( string description = null, CacheControl cacheControl = null, System.TimeSpan maxAge = null, string eTag = null, System.DateTime lastModified = null ) : HttpResult
Redirect ( string newLocationUri, HttpStatusCode redirectStatus = HttpStatusCode.Found ) : HttpResult
SetCookie ( string name, string value, System.DateTime expiresAt, string path, bool secure = false, bool httpOnly = false ) : void
SetCookie ( string name, string value, System.TimeSpan expiresIn, string path ) : void
SetPermanentCookie ( string name, string value ) : void
SetPermanentCookie ( string name, string value, string path ) : void
SetSessionCookie ( string name, string value ) : void
SetSessionCookie ( string name, string value, string path ) : void
SoftRedirect ( string newLocationUri, object response = null ) : HttpResult

Respond with a 'Soft redirect' so smart clients (e.g. ajax) have access to the response and can decide whether or not they should redirect

Status201Created ( object response, string newLocationUri ) : HttpResult
TriggerEvent ( object response, string eventName, string value = null ) : HttpResult

Decorate the response with an additional client-side event to instruct participating smart clients (e.g. ajax) with hints to transparently invoke client-side functionality

WritePartialTo ( IResponse response ) : void
WriteTo ( Stream responseStream ) : void

Private Methods

Method Description
DisposeStream ( ) : void
WriteTo ( Stream responseStream, int paddingLength ) : void

Method Details

DeleteCookie() public method

public DeleteCookie ( string name ) : void
name string
return void

GetContentLength() public method

public GetContentLength ( ) : long?
return long?

HttpResult() public method

public HttpResult ( ) : System
return System

HttpResult() public method

public HttpResult ( FileInfo fileResponse, bool asAttachment ) : System
fileResponse System.IO.FileInfo
asAttachment bool
return System

HttpResult() public method

public HttpResult ( FileInfo fileResponse, string contentType = null, bool asAttachment = false ) : System
fileResponse System.IO.FileInfo
contentType string
asAttachment bool
return System

HttpResult() public method

public HttpResult ( HttpStatusCode statusCode, string statusDescription ) : System
statusCode HttpStatusCode
statusDescription string
return System

HttpResult() public method

public HttpResult ( IVirtualFile fileResponse, bool asAttachment ) : System
fileResponse IVirtualFile
asAttachment bool
return System

HttpResult() public method

public HttpResult ( IVirtualFile fileResponse, string contentType = null, bool asAttachment = false ) : System
fileResponse IVirtualFile
contentType string
asAttachment bool
return System

HttpResult() public method

public HttpResult ( Stream responseStream, string contentType ) : System
responseStream Stream
contentType string
return System

HttpResult() public method

public HttpResult ( byte responseBytes, string contentType ) : System
responseBytes byte
contentType string
return System

HttpResult() public method

public HttpResult ( object response ) : System
response object
return System

HttpResult() public method

public HttpResult ( object response, HttpStatusCode statusCode ) : System
response object
statusCode HttpStatusCode
return System

HttpResult() public method

public HttpResult ( object response, string contentType ) : System
response object
contentType string
return System

HttpResult() public method

public HttpResult ( object response, string contentType, HttpStatusCode statusCode ) : System
response object
contentType string
statusCode HttpStatusCode
return System

HttpResult() public method

public HttpResult ( string responseText, string contentType ) : System
responseText string
contentType string
return System

NotModified() public static method

public static NotModified ( string description = null, CacheControl cacheControl = null, System.TimeSpan maxAge = null, string eTag = null, System.DateTime lastModified = null ) : HttpResult
description string
cacheControl CacheControl
maxAge System.TimeSpan
eTag string
lastModified System.DateTime
return HttpResult

Redirect() public static method

public static Redirect ( string newLocationUri, HttpStatusCode redirectStatus = HttpStatusCode.Found ) : HttpResult
newLocationUri string
redirectStatus HttpStatusCode
return HttpResult

SetCookie() public method

public SetCookie ( string name, string value, System.DateTime expiresAt, string path, bool secure = false, bool httpOnly = false ) : void
name string
value string
expiresAt System.DateTime
path string
secure bool
httpOnly bool
return void

SetCookie() public method

public SetCookie ( string name, string value, System.TimeSpan expiresIn, string path ) : void
name string
value string
expiresIn System.TimeSpan
path string
return void

SetPermanentCookie() public method

public SetPermanentCookie ( string name, string value ) : void
name string
value string
return void

SetPermanentCookie() public method

public SetPermanentCookie ( string name, string value, string path ) : void
name string
value string
path string
return void

SetSessionCookie() public method

public SetSessionCookie ( string name, string value ) : void
name string
value string
return void

SetSessionCookie() public method

public SetSessionCookie ( string name, string value, string path ) : void
name string
value string
path string
return void

SoftRedirect() public static method

Respond with a 'Soft redirect' so smart clients (e.g. ajax) have access to the response and can decide whether or not they should redirect
public static SoftRedirect ( string newLocationUri, object response = null ) : HttpResult
newLocationUri string
response object
return HttpResult

Status201Created() public static method

public static Status201Created ( object response, string newLocationUri ) : HttpResult
response object
newLocationUri string
return HttpResult

TriggerEvent() public static method

Decorate the response with an additional client-side event to instruct participating smart clients (e.g. ajax) with hints to transparently invoke client-side functionality
public static TriggerEvent ( object response, string eventName, string value = null ) : HttpResult
response object
eventName string
value string
return HttpResult

WritePartialTo() public method

public WritePartialTo ( IResponse response ) : void
response IResponse
return void

WriteTo() public method

public WriteTo ( Stream responseStream ) : void
responseStream Stream
return void