Files
transform/utils/request.ts
T
Ritesh Kumar d28b270ed9 feat(ts-to-flow): add server side converter for typescript to flow (#138) (#140)
* feat(ts-to-flow): add server side converter for typescript to flow

* fixes
2019-08-05 23:00:53 +05:30

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();
}