Class HttpApiClient
public class HttpApiClient : ApiClient, IDisposable, IAsyncDisposable
- Inheritance
-
HttpApiClient
- Implements
- Inherited Members
Constructors
HttpApiClient(bool?, bool?, string?, string?, string?, ICredential?, HttpOptions?, ClientOptions?)
public HttpApiClient(bool? enterprise = null, bool? vertexAI = null, string? apiKey = null, string? project = null, string? location = null, ICredential? credentials = null, HttpOptions? httpOptions = null, ClientOptions? clientOptions = null)
Parameters
enterprisebool?vertexAIbool?apiKeystringprojectstringlocationstringcredentialsICredentialhttpOptionsHttpOptionsclientOptionsClientOptions
Methods
RequestAsync(HttpMethod, string, string, HttpOptions?, CancellationToken)
Sends an HTTP request given the HTTP method, path, and request JSON string.
public override Task<ApiResponse> RequestAsync(HttpMethod httpMethod, string path, string requestJson, HttpOptions? requestHttpOptions, CancellationToken cancellationToken = default)
Parameters
httpMethodHttpMethodpathstringrequestJsonstringrequestHttpOptionsHttpOptionscancellationTokenCancellationToken
Returns
RequestStreamAsync(HttpMethod, string, string, HttpOptions?, CancellationToken)
Sends an HTTP request for streaming responses that return Server-Sent Events.
public override IAsyncEnumerable<ApiResponse> RequestStreamAsync(HttpMethod httpMethod, string path, string requestJson, HttpOptions? requestHttpOptions, CancellationToken cancellationToken = default)
Parameters
httpMethodHttpMethodThe HTTP method to use.
pathstringThe API path.
requestJsonstringThe request body as JSON string.
requestHttpOptionsHttpOptionsOptional HTTP options.
cancellationTokenCancellationTokenThe cancellation token to use.
Returns
- IAsyncEnumerable<ApiResponse>
An async enumerable of ApiResponse chunks.