form-urlencoded-post
v1.0.1
Published
Posting form data like jquery's $.post
Downloads
5
Maintainers
Readme
form-urlencoded-post
Jquery post alternative for application/x-www-form-urlencoded post requests.
Can't use jquery for size reasons? Because you can't access the dom? Trying to post in React Native? We gotchu..
Installation
$ npm install --save form-urlencoded-post
Example
import {post} from 'form-urlencoded-post';
let user = {name:'joe', skills:['dank memes']};
post('https://www.myapiurl.com/createUser', user).then(res => {
console.log("response:", res)
})
The post() call will return a thenable from a fetch() call.
You can also just add the code to your source if you need some customization. At the moment it's only 16 lines.