Class WebSocketMockResponse
A mock response object for the WebSocket protocol.
Inheritance
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class WebSocketMockResponse : WebResponse
Properties
ContentLength
When overridden in a descendant class, gets or sets the content length of data being received.
Declaration
public override long ContentLength { get; }
Property Value
Type | Description |
---|---|
System.Int64 | The number of bytes returned from the Internet resource. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
ContentType
When overridden in a derived class, gets or sets the content type of the data being received.
Declaration
public override string ContentType { get; }
Property Value
Type | Description |
---|---|
System.String | A string that contains the content type of the response. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Headers
When overridden in a derived class, gets a collection of header name-value pairs associated with this request.
Declaration
public override WebHeaderCollection Headers { get; }
Property Value
Type | Description |
---|---|
WebHeaderCollection | An instance of the System.Net.WebHeaderCollection class that contains header values associated with this response. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
ResponseUri
When overridden in a derived class, gets the URI of the Internet resource that actually responded to the request.
Declaration
public override Uri ResponseUri { get; }
Property Value
Type | Description |
---|---|
Uri | An instance of the System.Uri class that contains the URI of the Internet resource that actually responded to the request. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
StatusCode
Gets or set the status code of the response.
Declaration
public int StatusCode { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
GetResponseStream()
When overridden in a descendant class, returns the data stream from the Internet resource.
Declaration
public override System.IO.Stream GetResponseStream()
Returns
Type | Description |
---|---|
System.IO.Stream | An instance of the System.IO.Stream class for reading data from the Internet resource. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |