@fatcherjs/middleware-parameter
> $ npm install @fatcherjs/middleware-parameter
< script src ="https://cdn.jsdelivr.net/npm/fatcher/dist/fatcher.min.js "> </ script >
< script src ="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-parameter/dist/index.min.js "> </ script >
< script >
Fatcher . fatcher ( 'url' , {
middlewares : [ FatcherMiddlewareParameter ] ,
params : {
foo : 'bar' ,
} ,
} ) . then ( response => {
console . log ( response ) ;
} ) ;
</ script >
import { fatcher } from 'fatcher' ;
import { parameter } from '@fatcherjs/middleware-parameter' ;
fatcher ( 'https://foo.bar' , {
params : {
foo : 'bar' ,
} ,
middlewares : [ parameter ] ,
} ) ; // url is https://foo.bar?foo=bar
import qs from 'qs;
import { fatcher } from 'fatcher' ;
import { parameter , Serializer } from '@fatcherjs/middleware-parameter' ;
const serializer : Serializer = ( params ) => qs . stringify ( params ) ;
fatcher ( 'https://foo.bar' , {
params : {
foo : 'bar' ,
} ,
serializer,
middlewares : [ parameter ] ,
} ) ;
MIT