form-urlencoded-post

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i form-urlencoded-post

Weekly Downloads

4

Version

1.0.1

License

ISC

Last publish

Collaborators

  • joeroddy