MessageWebSocket.SetRequestHeader(String, String) MessageWebSocket.SetRequestHeader(String, String) MessageWebSocket.SetRequestHeader(String, String) MessageWebSocket.SetRequestHeader(String, String) MessageWebSocket.SetRequestHeader(String, String) Method

Definition

Adds an HTTP request header to the HTTP request message used in the WebSocket protocol handshake by the MessageWebSocket object.

public : void SetRequestHeader(Platform::String headerName, Platform::String headerValue)
void SetRequestHeader(winrt::hstring headerName, winrt::hstring headerValue) const;
public void SetRequestHeader(String headerName, String headerValue)
Public Sub SetRequestHeader(headerName As String, headerValue As String)
messageWebSocket.setRequestHeader(headerName, headerValue);

Parameters

headerName
String String String

The name of the request header.

headerValue
String String String

The value of the request header.

Remarks

The SetRequestHeader method must be called prior to calling the ConnectAsync method. Calling the SetRequestHeader method after calling the ConnectAsync method will result in an error.

Using the SetRequestHeader method to add a Sec-WebSocket-Extensions header is not supported.

See also