ServerResponseWriter
Namespace: Vercel.AI.Util
public static class ServerResponseWriterWrites a byte stream to a ServerResponse.
Inheritance: object
Methods
Section titled “Methods”WriteAsync(ServerResponse?, ReadableStream<byte[]>, int?, string?, HeaderCollection?)
Section titled “WriteAsync(ServerResponse?, ReadableStream<byte[]>, int?, string?, HeaderCollection?)”public static Task WriteAsync(ServerResponse? response, ReadableStream<byte[]> stream, int? status = null, string? statusText = null, HeaderCollection? headers = null)Sets status and headers, then writes <code class=“paramref”>stream</code>. A false write waits for SimulateDrain(). The response is ended even when reading the stream fails.
Parameters
| Name | Type | Description |
|---|---|---|
response |
ServerResponse | |
stream |
ReadableStream<byte\[\]> |
|
status |
int? | |
statusText |
string | |
headers |
HeaderCollection |
Returns: Task
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product