err use
const handleLogin = () => {
fetch("http://localhost:5000/login", {
method: "POST",
body: JSON.stringify(user),
});
};
right
import { Body } from '@tauri-apps/api/http';
body: Body.form(formData)|Body.json({a: 1})
Body类下面静态方法有:
static form(data: Record<string, Part> | FormData): Body;
static json(data: Record<any, any>): Body;
static text(value: string): Body;
static bytes(bytes: Iterable<number> | ArrayLike<number> | ArrayBuffer): Body;
标签:body,Body,tauri,json,static,fetch
From: https://www.cnblogs.com/sqmw/p/17065536.html