SkyWay Unity SDK
公式APIリファレンス
読み取り中…
検索中…
一致する文字列を見つけられません
WebSocketSharp.Net.HttpListenerResponse クラスsealed

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.

引数
cookieA Cookie to append.
例外
ArgumentNullExceptioncookie 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.

引数
nameA string that specifies the name of the header to append.
valueA string that specifies the value of the header to append.
例外
ArgumentExceptionname 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.
ArgumentNullExceptionname is null.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe 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.

引数
responseEntityAn array of byte that contains the entity body data.
willBlockA bool: true if this method blocks execution while flushing the stream to the client; otherwise, false.
例外
ArgumentNullExceptionresponseEntity is null.
ObjectDisposedExceptionThis instance is closed.

◆ CopyFrom()

void WebSocketSharp.Net.HttpListenerResponse.CopyFrom ( HttpListenerResponse templateResponse)
inline

Copies some properties from the specified response instance to this instance.

引数
templateResponseA HttpListenerResponse to copy.
例外
ArgumentNullExceptiontemplateResponse 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".

引数
urlA string that specifies the absolute URL to which the client is redirected to locate a requested resource.
例外
ArgumentExceptionurl is an empty string. -or- url is not an absolute URL.
ArgumentNullExceptionurl is null.
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis 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.

引数
cookieA Cookie to set.
例外
ArgumentExceptioncookie already exists in the cookies but it cannot be updated.
ArgumentNullExceptioncookie 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.

引数
nameA string that specifies the name of the header to set.
valueA string that specifies the value of the header to set.
例外
ArgumentExceptionname 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.
ArgumentNullExceptionname is null.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe 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.

例外
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis 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.

例外
ArgumentOutOfRangeExceptionThe value specified for a set operation is less than zero.
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis 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.

例外
ArgumentExceptionThe value specified for a set operation is an empty string. -or- The value specified for a set operation contains an invalid character.
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis instance is closed.

◆ Cookies

CookieCollection WebSocketSharp.Net.HttpListenerResponse.Cookies
getset

Gets or sets the collection of the HTTP cookies sent with the response.

A CookieCollection that contains the cookies sent with the response.

◆ Headers

WebHeaderCollection WebSocketSharp.Net.HttpListenerResponse.Headers
getset

Gets or sets the collection of the HTTP headers sent to the client.

A WebHeaderCollection that contains the headers sent to the client.

例外
InvalidOperationExceptionThe 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.

例外
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis 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.

例外
ObjectDisposedExceptionThis 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.

例外
ArgumentExceptionThe value specified for a set operation is an empty string. -or- The value specified for a set operation is not an absolute URL.
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis 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.

例外
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis 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.

例外
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis instance is closed.
System.Net.ProtocolViolationExceptionThe 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.

例外
ArgumentExceptionThe value specified for a set operation contains an invalid character.
ArgumentNullExceptionThe value specified for a set operation is null.
InvalidOperationExceptionThe response is already being sent.
ObjectDisposedExceptionThis instance is closed.

このクラス詳解は次のファイルから抽出されました: