Response
Namespace: Wisej.AI
Assembly: Wisej.AI
Represents a response that can be initialized with a stream or a string and provides methods to read its content.
- C#
- VB.NET
public class Response
Public Class Response
Constructors
Response(stream)
Initializes a new instance of the Response class with the specified stream.
| Name | Type | Description |
|---|---|---|
| stream | Stream | The stream to initialize the response with. |
Throws:
- ArgumentNullException Thrown when the stream is null.
Response(response)
Initializes a new instance of the Response class with the specified string.
| Name | Type | Description |
|---|---|---|
| response | String | The string to initialize the response with. |
Throws:
- ArgumentNullException Thrown when the response is null.
Properties
Stream
Stream: Gets a copy of the underlying stream.
The returned stream is a copy of the original stream, allowing for independent reading without affecting the original stream's position.
Methods
ReadBufferAsync()
Asynchronously reads the content of the response as a byte array.
Returns: Task<Byte[]>. A task that represents the asynchronous read operation. The task result contains the content of the response as a byte array.
This method reads the entire content of the stream and returns it as a byte array.
ReadContentAsync()
Asynchronously reads the content of the response as a string.
Returns: Task<String>. A task that represents the asynchronous read operation. The task result contains the content of the response as a string.
This method reads the entire content of the stream and returns it as a string.