HTTPRequest Event

Fires when an HTTP request is received.

Syntax

public event OnHTTPRequestHandler OnHTTPRequest;

public delegate void OnHTTPRequestHandler(object sender, AzurerelayreceiverHTTPRequestEventArgs e);

public class AzurerelayreceiverHTTPRequestEventArgs : EventArgs {
  public string ConnectionId { get; }
  public string RendezvousAddress { get; }
  public string Id { get; }
  public string RequestHeaders { get; }
  public string RequestTarget { get; }
  public string RequestMethod { get; }
  public string Host { get; }
  public string RemoteAddress { get; }
  public int RemotePort { get; }
  public string RequestData { get; }
public byte[] RequestDataB { get; } }
Public Event OnHTTPRequest As OnHTTPRequestHandler

Public Delegate Sub OnHTTPRequestHandler(sender As Object, e As AzurerelayreceiverHTTPRequestEventArgs)

Public Class AzurerelayreceiverHTTPRequestEventArgs Inherits EventArgs
  Public ReadOnly Property ConnectionId As String
  Public ReadOnly Property RendezvousAddress As String
  Public ReadOnly Property Id As String
  Public ReadOnly Property RequestHeaders As String
  Public ReadOnly Property RequestTarget As String
  Public ReadOnly Property RequestMethod As String
  Public ReadOnly Property Host As String
  Public ReadOnly Property RemoteAddress As String
  Public ReadOnly Property RemotePort As Integer
  Public ReadOnly Property RequestData As String
Public ReadOnly Property RequestDataB As Byte() End Class

Remarks

This event fires when an HTTP request is received. The parameters of this event describe the details of the HTTP request.

The ConnectionId value must be saved and used when calling SendHTTPResponse.

Parameter Descriptions

ConnectionId contains an identifier generated by the component to identify each connection. This identifier is unique to this connection.

RendezvousAddress holds the rendezvous URL to which the connection specific websocket connection may be made. This is for information only, no action needs to be taken based on this value. For instance: wss://g2-prod-by3-003-sb.servicebus.windows.net/$hc/hc1?sb-hc-action=request&sb-hc-id=e1df5efe-0988-450c-9512-f9f1d91b39a0_G2

Id holds the Id of the connection. If an Id was specified by the client it is present here, otherwise the Azure Relay service generates a value. For instance: 2d4acb89-7d15-4aeb-bcd5-66e031580a90_G21_G1.

RequestHeaders contains a JSON object containing the HTTP headers supplied to the Azure Relay service by the sender. Note that authorization values used to authenticate to the Azure Relay service, as well as all headers defined in RFC 7230 with the exception of Via are also stripped. For instance headers such as Content-Length are stripped by the relay and are not present in this value. For instance:

"requestHeaders": {
	"Accept-Encoding": "gzip, deflate",
	"Host": "nstest.servicebus.windows.net",
	"User-Agent": "IPWorks HTTP Component - www.nsoftware.com",
	"Via": "1.1 nstest.servicebus.windows.net"
}

RequestTarget is the request target including query string params, as defined in RFC 7230 section 5.3. For instance /hc1.

RequestMethod contains HTTP method sent in the request. For instance POST or GET.

Hostholds the Host header value of the connected client.

RemoteHost contains the IP address of the remote host that initiated the HTTP request (the client).

RemotePort contains the port used by the remote host to establish the connection.

RequestData holds the body of the HTTP request (if any).

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 .NET Edition - Version 20.0 [Build 8155]