Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Servers.HttpResponseWebSocket

Summary

Encapsulates a response to an HTTP request that indicates to the client that they should switch to the WebSocket protocol.

Constructors

HttpResponseWebSocket(WebSocket websocket, string subprotocol = null, HttpResponseHeaders headers = null)
Constructor.

Static methods

HttpResponseContent
Create(string content, string contentType, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the specified content to the client with the specified MIME type.
HttpResponseContent
Create(byte[] content, string contentType, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified byte array to the client with the specified MIME type.
HttpResponseContent
Create(Stream content, string contentType, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified stream to the client with the specified MIME type.
HttpResponseContent
Create(IEnumerable<string> content, string contentType, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null, bool buffered = true)
Returns the specified content to the client as a single concatenated piece of text with the specified MIME type.
HttpResponseContent
Css(string content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the specified content to the client with the MIME type “text/css; charset=utf-8”.
HttpResponseContent
Css(byte[] content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified byte array to the client.
HttpResponseContent
Css(Stream content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified stream to the client.
HttpResponseContent
Css(IEnumerable<string> content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null, bool buffered = true)
Returns the specified content to the client as a single concatenated piece of text with the MIME type “text/css; charset=utf-8”.
HttpResponseContent Returns a response to the client consisting of an empty body.
HttpResponseContent
File(string filePath, string contentType = null, int? maxAge = 3600, DateTime? ifModifiedSince = null)
Returns the specified file from the local file system using the specified MIME content type to the client.
HttpResponseContent
Html(string content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the specified content to the client with the MIME type “text/html; charset=utf-8”.
HttpResponseContent
Html(byte[] content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified byte array to the client.
HttpResponseContent
Html(Stream content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified stream to the client.
HttpResponseContent
Html(Tag content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null, bool buffered = true)
Returns the specified tag content to the client.
HttpResponseContent
Html(IEnumerable<string> content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null, bool buffered = true)
Returns the specified content to the client as a single concatenated piece of text with the MIME type “text/html; charset=utf-8”.
HttpResponseContent
JavaScript(string content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the specified content to the client with the MIME type “text/javascript; charset=utf-8”.
HttpResponseContent
JavaScript(byte[] content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified byte array to the client.
HttpResponseContent
JavaScript(Stream content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified stream to the client.
HttpResponseContent
JavaScript(IEnumerable<string> content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null, bool buffered = true)
Returns the specified content to the client as a single concatenated piece of text with the MIME type “text/javascript; charset=utf-8”.
HttpResponseContent Returns the specified content to the client with the MIME type “application/json; charset=utf-8”.
HttpResponseContentGenerates a 304 Not Modified response.
HttpResponseContent
PlainText(string content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the specified content to the client with the MIME type “text/plain; charset=utf-8”.
HttpResponseContent
PlainText(byte[] content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified byte array to the client.
HttpResponseContent
PlainText(Stream content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null)
Returns the contents of the specified stream to the client.
HttpResponseContent
PlainText(IEnumerable<string> content, HttpStatusCode status = HttpStatusCode._200_OK, HttpResponseHeaders headers = null, bool buffered = true)
Returns the specified content to the client as a single concatenated piece of text with the MIME type “text/plain; charset=utf-8”.
HttpResponseContent
Redirect(string newUrl)
Redirects the client to a new URL, using the HTTP status code 302 Found and making the response uncacheable.
HttpResponseContent
HttpResponseWebSocket
WebSocket(WebSocket websocket, string subprotocol = null, HttpResponseHeaders headers = null)
Returns an HttpResponseWebSocket which indicates to the client that the HTTP connection should switch to the WebSocket protocol.

Instance methods

StreamReturns null. Overridden only by HttpResponseContent.

Operators

HttpResponse Provides an implicit conversion from WebSocket to HttpResponse by assuming no subprotocol and no extra HTTP response headers.

Instance properties

HttpResponseHeadersThe HTTP response headers which are to be sent back to the HTTP client as part of this HTTP response.
HttpStatusCodeThe HTTP status code. For example, 200 OK, 404 Not Found, 500 Internal Server Error. Default is 200 OK.
stringThe server’s selection of a subprotocol, if the client specified any subprotocols in the request.
WebSocketThe WebSocket implementation to use for the remainder of the connection.