@fatcherjs/middleware-form-data
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@fatcherjs/middleware-form-data

A middleware for consuming payload to form data

codecov install size Size npm package build status

Install

NPM

>$ npm install @fatcherjs/middleware-form-data

CDN

<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-form-data/dist/form-data.min.js"></script>

Usage

import { formData } from '@fatcherjs/middleware-form-data';
import { fatcher } from 'fatcher';

fatcher({
    url: '/bar/foo',
    middlewares: [formData()],
    payload: {
        bar: 'foo',
    },
    headers: {
        'Content-Type': 'multipart/form-data',
    },
})
    .then(res => {
        console.log(res);
    })
    .catch(err => {
        console.error(error);
    });

License

LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i @fatcherjs/middleware-form-data

Weekly Downloads

15

Version

2.0.0

License

MIT

Unpacked Size

7.5 kB

Total Files

7

Last publish

Collaborators

  • fanhaoyuan