Class ApiResponse
The API response contains a response to a call to the GenAI APIs. This class is abstract and implements IDisposable for resource management.
public abstract class ApiResponse : IDisposable, IAsyncDisposable
- Inheritance
-
ApiResponse
- Implements
- Derived
- Inherited Members
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the ApiResponse and optionally releases the managed resources. Subclasses must override this method to provide their specific cleanup logic.
protected void Dispose(bool disposing)
Parameters
disposingbooltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
DisposeAsync()
Asynchronously disposes the response.
public virtual ValueTask DisposeAsync()
Returns
DisposeManagedResources()
protected virtual void DisposeManagedResources()
GetEntity()
Gets the HTTP content of the response.
public abstract HttpContent GetEntity()
Returns
GetHeaders()
Gets the headers of the HTTP response. This uses the .NET standard HttpResponseHeaders collection.
public abstract HttpResponseHeaders GetHeaders()