@fatcherjs/middleware-form-data
v3.0.0
Published
<div align="center"> <a href="https://codecov.io/github/fatcherjs/middleware-form-data" > <img src="https://codecov.io/github/fatcherjs/middleware-form-data/graph/badge.svg?token=RPCSSLFSNF"/> </a> <a href="https://www.jsdelivr.com/package/npm/
Readme
@fatcherjs/middleware-form-data
This middleware is Browser Only.
Install
NPM
>$ npm install @fatcherjs/middleware-form-dataCDN
<script src="https://cdn.jsdelivr.net/npm/fatcher/dist/fatcher.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-form-data/dist/index.min.js"></script>
<script>
Fatcher.fatcher('url', {
middlewares: [FatcherMiddlewareFormData],
body: document.querySelector('#login-form'), // HTMLFormElement
method: 'POST',
}).then(response => {
console.log(response);
});
</script>Usage
import { fatcher } from 'fatcher';
import { formData } from '@fatcherjs/middleware-form-data';
fatcher('https://foo.bar', {
middlewares: [formData],
method: 'POST',
// Body Supports HTMLFormElement / Object / FormData
body: {
foo: 'bar',
test: 'a',
},
});