Click or drag to resize

HttpServerResponse Class

The HttpServerResponse class is used to create a server response that is sent back to the client by the HttpServer.
Inheritance Hierarchy

Namespace: Crestron.SimplSharp.Net.Http
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public class HttpServerResponse : HttpOutgoingRequestResponse

The HttpServerResponse type exposes the following members.

Constructors
 NameDescription
Protected methodHttpServerResponse Creates a new instance of the HttpServerResponse class.
Top
Properties
 NameDescription
Protected propertyClient Always False.
(Overrides HttpRequestResponseClient)
Public propertyCloseStream When ContentSource is set to ContentStream (and a ContentStream is assigned), this property determines if the stream should be closed automatically after sending it to the connection (true) or not (false).
(Inherited from HttpOutgoingRequestResponse)
Public propertyCode Gets or sets the HTTP status code of the response. The default value is 200.
Public propertyContentBytes Assigns a byte array to send back as the HTTP body to this property.
(Inherited from HttpOutgoingRequestResponse)
Public propertyContentSource Defines which property (ContentBytes, ContentStream or ContentString) will be used to send the body of the response. Assigning any of these three properties will automatically set the ContentSource property so that the content will always be sent from the appropriate source.
(Inherited from HttpOutgoingRequestResponse)
Public propertyContentStream Assigns a stream to send back as HTTP body to this property. When assigned (and ContentSource is set to ContentStream), you can use the CloseStream property to determine if the stream should be closed automatically after sending it to the connection (true) or not (false).
(Inherited from HttpOutgoingRequestResponse)
Public propertyContentString Assigns a string to send back as HTTP body to this property.
(Inherited from HttpOutgoingRequestResponse)
Public propertyEncoding Determines the Encoding for the HTTP Request Response
(Inherited from HttpRequestResponse)
Protected propertyHasOnTransferProgress Determines whether the current HTTPRequest Response has an OnTransferProgress event handler.
(Inherited from HttpRequestResponse)
Public propertyHeader Get or set the HTTP Response Header
(Inherited from HttpRequestResponse)
Public propertyIsCompleted Gets a value that indicates whether the asynchronous operation completed.
(Inherited from HttpRequestResponse)
Public propertyKeepAlive Determines the keep alive status of the HTTP Outgoing Request Response.
(Inherited from HttpOutgoingRequestResponse)
Public propertyResponseText Gets or sets the HTTP status code description (For example, OK when the Code is 200). It is up to the caller to ensure that the Code and the ResponseText values correspond to each other. The default value is OK.
Protected propertyServer Always True.
(Overrides HttpRequestResponseServer)
Public propertyThisClient Gets the Client that is host to this Async request
(Inherited from HttpRequestResponse)
Top
Methods
 NameDescription
Public methodCloneEvents Clones the events of the HTTP Request Response.
(Inherited from HttpRequestResponse)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodFinalizeHeader This method finalizes the HTTP header. It sets the correct value of the Content-Length header and sets the HTTP version header to 1.1.
(Overrides HttpOutgoingRequestResponseFinalizeHeader)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodSendError(Int32, String) Wraps the provided error message into an HTML document and puts the resulting document into ContentBytes. This method always sets the ResponseText to ERROR.
Public methodSendError(Int32, String, Exception) Wraps the provided System.Exception object, including the exception type name, exception message and full stacktrace into an HTML document and puts the resulting document into ContentBytes.
Public methodSendError(Int32, String, String) Wraps the provided error message into an HTML document and puts the resulting document into ContentBytes.
Public methodSendErrorWithCustomBody Allows to set custom error messages. Unlike the SendError methods, this method doesn't wrap the provided text into any HTML tags. The provided response body is used as is.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Protected methodTriggerOnTransferEnd Trigger the OnTransferEnd Event Handler
(Inherited from HttpRequestResponse)
Protected methodTriggerOnTransferProgress Trigger the OnTransferProgress Event Handler
(Inherited from HttpRequestResponse)
Protected methodTriggerOnTransferStart Trigger the OnTransferStart Event Handler
(Inherited from HttpRequestResponse)
Top
Events
 NameDescription
Public eventOnTransferEnd OnTransferEnd Event Handler
(Inherited from HttpRequestResponse)
Public eventOnTransferProgress OnTransferProgress Event Handler
(Inherited from HttpRequestResponse)
Public eventOnTransferStart OnTransferStart Event handler
(Inherited from HttpRequestResponse)
Top

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also