🚀 Fully Compatible
Based on axios, retaining all features like interceptors and configurations.
A wrapper library based on axios providing out-of-the-box streaming request interfaces.
const response = await fetch("/api/chat", {
method: "POST",
body: JSON.stringify({ msg: "hi" }),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}await request.stream({ url: "/api/chat", data: { msg: "hi" } }, (chunk) =>
console.log(chunk),
);