Represents an HTTP response to an HTTP request received by a HttpListener instance.
[詳解]
|
|
void | Abort () |
| | Closes the connection to the client without sending a response.
|
| |
| void | AppendCookie (Cookie cookie) |
| | Appends an HTTP cookie to the cookies sent with the response.
|
| |
| void | AppendHeader (string name, string value) |
| | Appends an HTTP header with the specified name and value to the headers for the response.
|
| |
|
void | Close () |
| | Sends the response to the client and releases the resources used by this instance.
|
| |
| void | Close (byte[] responseEntity, bool willBlock) |
| | Sends the response with the specified entity body data to the client and releases the resources used by this instance.
|
| |
| void | CopyFrom (HttpListenerResponse templateResponse) |
| | Copies some properties from the specified response instance to this instance.
|
| |
| void | Redirect (string url) |
| | Configures the response to redirect the client's request to the specified URL.
|
| |
| void | SetCookie (Cookie cookie) |
| | Adds or updates an HTTP cookie in the cookies sent with the response.
|
| |
| void | SetHeader (string name, string value) |
| | Adds or updates an HTTP header with the specified name and value in the headers for the response.
|
| |
|
| Encoding | ContentEncoding [get, set] |
| | Gets or sets the encoding for the entity body data included in the response.
|
| |
| long | ContentLength64 [get, set] |
| | Gets or sets the number of bytes in the entity body data included in the response.
|
| |
| string | ContentType [get, set] |
| | Gets or sets the media type of the entity body included in the response.
|
| |
| CookieCollection | Cookies [get, set] |
| | Gets or sets the collection of the HTTP cookies sent with the response.
|
| |
| WebHeaderCollection | Headers [get, set] |
| | Gets or sets the collection of the HTTP headers sent to the client.
|
| |
| bool | KeepAlive [get, set] |
| | Gets or sets a value indicating whether the server requests a persistent connection.
|
| |
| Stream | OutputStream [get] |
| | Gets a stream instance to which the entity body data can be written.
|
| |
| Version | ProtocolVersion [get] |
| | Gets the HTTP version used for the response.
|
| |
| string | RedirectLocation [get, set] |
| | Gets or sets the URL to which the client is redirected to locate a requested resource.
|
| |
| bool | SendChunked [get, set] |
| | Gets or sets a value indicating whether the response uses the chunked transfer encoding.
|
| |
| int | StatusCode [get, set] |
| | Gets or sets the HTTP status code returned to the client.
|
| |
| string | StatusDescription [get, set] |
| | Gets or sets the description of the HTTP status code returned to the client.
|
| |
Represents an HTTP response to an HTTP request received by a HttpListener instance.
This class cannot be inherited.
◆ AppendCookie()
| void WebSocketSharp.Net.HttpListenerResponse.AppendCookie |
( |
Cookie | cookie | ) |
|
|
inline |
Appends an HTTP cookie to the cookies sent with the response.
- 引数
-
- 例外
-
| ArgumentNullException | cookie is null. |
◆ AppendHeader()
| void WebSocketSharp.Net.HttpListenerResponse.AppendHeader |
( |
string | name, |
|
|
string | value ) |
|
inline |
Appends an HTTP header with the specified name and value to the headers for the response.
- 引数
-
| name | A string that specifies the name of the header to append. |
| value | A string that specifies the value of the header to append. |
- 例外
-
| ArgumentException | name is an empty string. -or- name is a string of spaces. -or- name contains an invalid character. -or- value contains an invalid character. -or- name is a restricted header name. |
| ArgumentNullException | name is null. |
| ArgumentOutOfRangeException | The length of value is greater than 65,535 characters. |
| InvalidOperationException | The current headers do not allow the header. |
◆ Close()
| void WebSocketSharp.Net.HttpListenerResponse.Close |
( |
byte[] | responseEntity, |
|
|
bool | willBlock ) |
|
inline |
Sends the response with the specified entity body data to the client and releases the resources used by this instance.
- 引数
-
| responseEntity | An array of byte that contains the entity body data. |
| willBlock | A bool: true if this method blocks execution while flushing the stream to the client; otherwise, false. |
- 例外
-
| ArgumentNullException | responseEntity is null. |
| ObjectDisposedException | This instance is closed. |
◆ CopyFrom()
Copies some properties from the specified response instance to this instance.
- 引数
-
- 例外
-
| ArgumentNullException | templateResponse is null. |
◆ Redirect()
| void WebSocketSharp.Net.HttpListenerResponse.Redirect |
( |
string | url | ) |
|
|
inline |
Configures the response to redirect the client's request to the specified URL.
This method sets the RedirectLocation property to url , the StatusCode property to 302, and the StatusDescription property to "Found".
- 引数
-
| url | A string that specifies the absolute URL to which the client is redirected to locate a requested resource. |
- 例外
-
| ArgumentException | url is an empty string. -or- url is not an absolute URL. |
| ArgumentNullException | url is null. |
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ SetCookie()
| void WebSocketSharp.Net.HttpListenerResponse.SetCookie |
( |
Cookie | cookie | ) |
|
|
inline |
Adds or updates an HTTP cookie in the cookies sent with the response.
- 引数
-
- 例外
-
| ArgumentException | cookie already exists in the cookies but it cannot be updated. |
| ArgumentNullException | cookie is null. |
◆ SetHeader()
| void WebSocketSharp.Net.HttpListenerResponse.SetHeader |
( |
string | name, |
|
|
string | value ) |
|
inline |
Adds or updates an HTTP header with the specified name and value in the headers for the response.
- 引数
-
| name | A string that specifies the name of the header to set. |
| value | A string that specifies the value of the header to set. |
- 例外
-
| ArgumentException | name is an empty string. -or- name is a string of spaces. -or- name contains an invalid character. -or- value contains an invalid character. -or- name is a restricted header name. |
| ArgumentNullException | name is null. |
| ArgumentOutOfRangeException | The length of value is greater than 65,535 characters. |
| InvalidOperationException | The current headers do not allow the header. |
◆ ContentEncoding
| Encoding WebSocketSharp.Net.HttpListenerResponse.ContentEncoding |
|
getset |
Gets or sets the encoding for the entity body data included in the response.
A Encoding that represents the encoding for the entity body data.
null if no encoding is specified.
The default value is null.
- 例外
-
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ ContentLength64
| long WebSocketSharp.Net.HttpListenerResponse.ContentLength64 |
|
getset |
Gets or sets the number of bytes in the entity body data included in the response.
A long that represents the number of bytes in the entity body data.
It is used for the value of the Content-Length header.
The default value is zero.
- 例外
-
| ArgumentOutOfRangeException | The value specified for a set operation is less than zero. |
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ ContentType
| string WebSocketSharp.Net.HttpListenerResponse.ContentType |
|
getset |
Gets or sets the media type of the entity body included in the response.
A string that represents the media type of the entity body.
It is used for the value of the Content-Type header.
null if no media type is specified.
The default value is null.
- 例外
-
| ArgumentException | The value specified for a set operation is an empty string. -or- The value specified for a set operation contains an invalid character. |
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ Cookies
Gets or sets the collection of the HTTP cookies sent with the response.
A CookieCollection that contains the cookies sent with the response.
◆ Headers
Gets or sets the collection of the HTTP headers sent to the client.
A WebHeaderCollection that contains the headers sent to the client.
- 例外
-
| InvalidOperationException | The value specified for a set operation is not valid for a response. |
◆ KeepAlive
| bool WebSocketSharp.Net.HttpListenerResponse.KeepAlive |
|
getset |
Gets or sets a value indicating whether the server requests a persistent connection.
true if the server requests a persistent connection; otherwise, false.
The default value is true.
- 例外
-
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ OutputStream
| Stream WebSocketSharp.Net.HttpListenerResponse.OutputStream |
|
get |
Gets a stream instance to which the entity body data can be written.
A Stream instance to which the entity body data can be written.
- 例外
-
| ObjectDisposedException | This instance is closed. |
◆ ProtocolVersion
| Version WebSocketSharp.Net.HttpListenerResponse.ProtocolVersion |
|
get |
Gets the HTTP version used for the response.
A Version that represents the HTTP version used for the response.
Always returns same as 1.1.
◆ RedirectLocation
| string WebSocketSharp.Net.HttpListenerResponse.RedirectLocation |
|
getset |
Gets or sets the URL to which the client is redirected to locate a requested resource.
A string that represents the absolute URL for the redirect location.
It is used for the value of the Location header.
null if no redirect location is specified.
The default value is null.
- 例外
-
| ArgumentException | The value specified for a set operation is an empty string. -or- The value specified for a set operation is not an absolute URL. |
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ SendChunked
| bool WebSocketSharp.Net.HttpListenerResponse.SendChunked |
|
getset |
Gets or sets a value indicating whether the response uses the chunked transfer encoding.
true if the response uses the chunked transfer encoding; otherwise, false.
The default value is false.
- 例外
-
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
◆ StatusCode
| int WebSocketSharp.Net.HttpListenerResponse.StatusCode |
|
getset |
Gets or sets the HTTP status code returned to the client.
An int that represents the HTTP status code for the response to the request.
The default value is 200. It indicates that the request has succeeded.
- 例外
-
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
| System.Net.ProtocolViolationException | The value specified for a set operation is invalid. Valid values are between 100 and 999 inclusive. |
◆ StatusDescription
| string WebSocketSharp.Net.HttpListenerResponse.StatusDescription |
|
getset |
Gets or sets the description of the HTTP status code returned to the client.
A string that represents the description of the HTTP status code for the response to the request.
The default value is the RFC 2616
description for the StatusCode property value.
An empty string if an RFC 2616 description does not exist.
- 例外
-
| ArgumentException | The value specified for a set operation contains an invalid character. |
| ArgumentNullException | The value specified for a set operation is null. |
| InvalidOperationException | The response is already being sent. |
| ObjectDisposedException | This instance is closed. |
このクラス詳解は次のファイルから抽出されました:
- SkyWayUnitySDK/Assets/SkyWay/Scripts/Deps/websocket-sharp/websocket-sharp/Net/HttpListenerResponse.cs