tsx
const response = jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) json<{
hello: string;
}>(data: {
hello: string;
}, init?: number | ResponseInit): Response
import json
({ hello: "world" });
tsx
const response = jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) json<{
hello: string;
}>(data: {
hello: string;
}, init?: number | ResponseInit): Response
import json
({ hello: "world" });
It is useful for sending JSON responses from API Routes.
tsx
import { jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) function json<Data>(data: Data, init?: number | ResponseInit): Response
import json
} from "solid-start";
return jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) json<{
hello: string;
}>(data: {
hello: string;
}, init?: number | ResponseInit): Response
import json
({ hello: "world" }); }
tsx
import { jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) function json<Data>(data: Data, init?: number | ResponseInit): Response
import json
} from "solid-start";
return jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) json<{
hello: string;
}>(data: {
hello: string;
}, init?: number | ResponseInit): Response
import json
({ hello: "world" }); }
ts
import { jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) function json<Data>(data: Data, init?: number | ResponseInit): Response
import json
} from "solid-start";
const response = jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) json<{
hello: string;
}>(data: {
hello: string;
}, init?: number | ResponseInit): Response
import json
({ hello: "world" });
ts
import { jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) function json<Data>(data: Data, init?: number | ResponseInit): Response
import json
} from "solid-start";
const response = jsonA JSON response. Converts `data` to JSON and sets the `Content-Type` header.
(alias) json<{
hello: string;
}>(data: {
hello: string;
}, init?: number | ResponseInit): Response
import json
({ hello: "world" });