mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
DataApi: automatically switch to POST if the URL is too long
This commit is contained in:
@@ -28,6 +28,8 @@ describe("ModuleApi", () => {
|
||||
it("fetches endpoint", async () => {
|
||||
const app = new Hono().get("/endpoint", (c) => c.json({ foo: "bar" }));
|
||||
const api = new Api({ host });
|
||||
|
||||
// @ts-expect-error it's protected
|
||||
api.fetcher = app.request as typeof fetch;
|
||||
|
||||
const res = await api.get("/endpoint");
|
||||
@@ -40,6 +42,8 @@ describe("ModuleApi", () => {
|
||||
it("has accessible request", async () => {
|
||||
const app = new Hono().get("/endpoint", (c) => c.json({ foo: "bar" }));
|
||||
const api = new Api({ host });
|
||||
|
||||
// @ts-expect-error it's protected
|
||||
api.fetcher = app.request as typeof fetch;
|
||||
|
||||
const promise = api.get("/endpoint");
|
||||
|
||||
Reference in New Issue
Block a user