mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
9 lines
218 B
TypeScript
9 lines
218 B
TypeScript
export default async function request(url: string, data: any) {
|
|
const res = await fetch(url, {
|
|
method: "POST",
|
|
body: typeof data === "object" ? JSON.stringify(data) : data
|
|
});
|
|
|
|
return await res.text();
|
|
}
|