Skip to main content

BridgeHttpRequest

Namespace: BlazorNative.Core

An HTTP request to route through the host bridge (IMobileBridge.FetchAsync(BridgeHttpRequest, CancellationToken)), so the native layer owns TLS, permissions and proxying. BridgeHttpRequest.Url is required; a default(BridgeHttpRequest) is not a valid request (null Url/Method).

public readonly record struct BridgeHttpRequest

Inheritance ObjectValueTypeBridgeHttpRequest
Implements IEquatable<BridgeHttpRequest>
Attributes NullableContextAttribute, NullableAttribute, IsReadOnlyAttribute

Properties

Url

The absolute request URL.

public string Url { get; init; }

Property Value

String

Method

The HTTP method; defaults to GET.

public string Method { get; init; }

Property Value

String

Body

The request body, or null for none.

public string? Body { get; init; }

Property Value

String

Headers

Request headers, or null for none.

public IReadOnlyDictionary<string, string>? Headers { get; init; }

Property Value

IReadOnlyDictionary<String, String>

Constructors

BridgeHttpRequest(String, String, String, IReadOnlyDictionary<String, String>)

An HTTP request to route through the host bridge (IMobileBridge.FetchAsync(BridgeHttpRequest, CancellationToken)), so the native layer owns TLS, permissions and proxying. BridgeHttpRequest.Url is required; a default(BridgeHttpRequest) is not a valid request (null Url/Method).

public BridgeHttpRequest(string Url, string Method = "GET", string? Body = null, IReadOnlyDictionary<string, string>? Headers = null)

Parameters

Url String
The absolute request URL.

Method String
The HTTP method; defaults to GET.

Body String?
The request body, or null for none.

Headers IReadOnlyDictionary<String, String>?
Request headers, or null for none.