SmartEndpoint.Response
Wisej.AI.SmartEndpoint Response
Namespace: Wisej.AI
Assembly: Wisej.AI (3.5.0.0)
Represents a response that can be initialized with a stream or a string and provides methods to read its content.
public class Response
Constructors
Response(stream)

Initializes a new instance of the Response class with the specified stream.
Throws:
ArgumentNullException Thrown when the stream is null.
Response(response)

Initializes a new instance of the Response class with the specified string.
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.
Last updated