Method SendAsync
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
urlstringThe absolute destination URL.
methodHttpMethodThe HTTP method.
bodybyte[]The request body; null or empty sends none.
contentTypestringThe body's Content-Type header value; ignored without a body.
cancellationTokenCancellationTokenCancels the request.