Skip to the content.

POST Form

POST 请求发送表单数据的示例。

import { Fetcher, POST, form } from 'es-fetch-api'

const { getJSON } = new Fetcher('https://example.com/api/v1')

export const login = (username, password) =>
    getJSON('login', POST, form({ username, password }))

form() 中间件会: