My Project
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
WebSocketSharp.Server.HttpRequestEventArgs Class Reference

Represents the event data for the HTTP request events of the HttpServer class. More...

Inheritance diagram for WebSocketSharp.Server.HttpRequestEventArgs:

Public Member Functions

byte[] ReadFile (string path)
 Reads the specified file from the document folder of the HttpServer class.
 
bool TryReadFile (string path, out byte[] contents)
 Tries to read the specified file from the document folder of the HttpServer class.
 

Properties

HttpListenerRequest Request [get]
 Gets the request data sent from a client.
 
HttpListenerResponse Response [get]
 Gets the response data to return to the client.
 
IPrincipal User [get]
 Gets the information for the client.
 

Detailed Description

Represents the event data for the HTTP request events of the HttpServer class.

An HTTP request event occurs when the HttpServer instance receives an HTTP request.

You should access the Request property if you would like to get the request data sent from a client.

And you should access the Response property if you would like to get the response data to return to the client.

Member Function Documentation

◆ ReadFile()

byte[] WebSocketSharp.Server.HttpRequestEventArgs.ReadFile ( string  path)
inline

Reads the specified file from the document folder of the HttpServer class.

Returns
An array of byte or null if it fails.

That array receives the contents of the file.

Parameters
pathA string that specifies a virtual path to find the file from the document folder.
Exceptions
ArgumentNullExceptionpath is null.
ArgumentExceptionpath is an empty string. -or- path contains "..".

◆ TryReadFile()

bool WebSocketSharp.Server.HttpRequestEventArgs.TryReadFile ( string  path,
out byte[]  contents 
)
inline

Tries to read the specified file from the document folder of the HttpServer class.

Returns
true if it succeeds to read; otherwise, false.
Parameters
pathA string that specifies a virtual path to find the file from the document folder.
contentsWhen this method returns, an array of byte or null if it fails. That array receives the contents of the file.
Exceptions
ArgumentNullExceptionpath is null.
ArgumentExceptionpath is an empty string. -or- path contains "..".

Property Documentation

◆ Request

HttpListenerRequest WebSocketSharp.Server.HttpRequestEventArgs.Request
get

Gets the request data sent from a client.

A HttpListenerRequest that provides the methods and properties for the request data.

◆ Response

HttpListenerResponse WebSocketSharp.Server.HttpRequestEventArgs.Response
get

Gets the response data to return to the client.

A HttpListenerResponse that provides the methods and properties for the response data.

◆ User

IPrincipal WebSocketSharp.Server.HttpRequestEventArgs.User
get

Gets the information for the client.

A IPrincipal instance or null if not authenticated.

That instance describes the identity, authentication scheme, and security roles for the client.


The documentation for this class was generated from the following file: