Table of Contents

Method SendAsync

Namespace
LMKit.Agents.Tools.BuiltIn.Net
Assembly
LM-Kit.NET.dll

SendAsync(string, HttpMethod, byte[], string, CancellationToken)

Sends a request of any method under the policy, with an optional body. Every hop is validated and connects pinned exactly like FetchAsync(string, CancellationToken). Redirects are followed (and revalidated) for GET and HEAD only: any other method changes state, so a redirect answer is returned as it is, never replayed elsewhere. Throws InvalidOperationException with the gate's own reason when the destination is refused; a refused request never opens a connection.

public Task<WebEgressFetcher.FetchResult> SendAsync(string url, HttpMethod method, byte[] body, string contentType, CancellationToken cancellationToken = default)

Parameters

url string

The absolute destination URL.

method HttpMethod

The HTTP method.

body byte[]

The request body; null or empty sends none.

contentType string

The body's Content-Type header value; ignored without a body.

cancellationToken CancellationToken

Cancels the request.

Returns

Task<WebEgressFetcher.FetchResult>
Share