@bigcommerce/form-poster
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

form-poster

Build Status

This is a JavaScript library for making a POST request as if you are submitting a HTML form. The request will have application/x-www-form-urlencoded content-type header. This is useful in situations where you want the same behaviour as submitting a HTML form without actually having the form in DOM.

Usage

You can install this package using npm or yarn. Below is an example of how to use it.

import { createFormPoster } from 'form-poster';

const formPoster = createFormPoster();
const url = '/url/123';
const data = { field_1: 'foo', field_2: 'bar' };

formPoster.postForm(url, data, () => {
    console.log('done');
});

Development

To install dependencies:

npm install

To transpile source code:

npm run build

To bump and tag a release:

npm run release

/@bigcommerce/form-poster/

    Package Sidebar

    Install

    npm i @bigcommerce/form-poster

    Weekly Downloads

    1,560

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    23.6 kB

    Total Files

    23

    Last publish

    Collaborators

    • erik.christensen
    • leebigcommerce
    • toma-r
    • cilo
    • jorgemoya
    • bcnpmuser
    • icatalina
    • chris.boulton
    • bcandreik
    • davidchin
    • pascal.zajac
    • deini
    • chanceaclark
    • jairobc
    • jmwiese