CustomRequest Event
Reports a request of a non-standard type (method).
Syntax
public event OnCustomRequestHandler OnCustomRequest; public delegate void OnCustomRequestHandler(object sender, RestserverCustomRequestEventArgs e); public class RestserverCustomRequestEventArgs : EventArgs { public long ConnectionID { get; } public string URI { get; } public string HTTPMethod { get; } public bool Handled { get; set; } }
Public Event OnCustomRequest As OnCustomRequestHandler Public Delegate Sub OnCustomRequestHandler(sender As Object, e As RestserverCustomRequestEventArgs) Public Class RestserverCustomRequestEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property URI As String Public ReadOnly Property HTTPMethod As String Public Property Handled As Boolean End Class
Remarks
The component fires this event to notify the application about a non-standard request received from the client. The HTTPMethod contains the non-standard HTTP method.
ConnectionID indicates the connection that sent the request and URI suggests the requested resource.
Set Handled to true to indicate that your application's code will take care of the request. The application does it by providing the necessary details via SetResponseStatus, SetResponseHeader, and SetResponseFile methods. If the returned value of Handled is false, the server will try to take care of the request automatically by searching for the requested resource in DocumentRoot.