首页 > 其他分享 >tauri fetch body bug

tauri fetch body bug

时间:2023-01-23 21:23:52浏览次数:41  
标签:body Body tauri json static fetch

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

相关文章