包详细信息

@bigcommerce/form-poster

bigcommerce13.1kMIT1.5.3

A JavaScript library for posting HTML form data

自述文件

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

更新日志

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.5.3 (2025-05-01)

1.5.2 (2025-02-22)

1.5.1 (2025-02-22)

1.5.0 (2024-02-26)

Features

  • payment: PAYPAL-3453 deleted the line with deleting an element from the DOM (c9d55d2)

1.4.2 (2024-01-16)

Bug Fixes

  • common: FE-00 Only run commit-validation in PRs (f2208c4)
  • common: FE-00 Use correct scope for PULL_REQUEST_TEMPLATE (2c544b4)

1.4.0 (2019-11-12)

Features

  • core: INT-1997 Add optional target parameter (6676d75)

1.3.0 (2018-11-14)

Features

  • core: CHECKOUT-3747 Configure instance with host URL (a173807)

1.2.3 (2018-06-22)

Bug Fixes

  • core: CHECKOUT-3191 Export FormPoster (2731cf2)

1.2.2 (2018-05-28)

Bug Fixes

  • common: CHECKOUT-3191 Fix sourcemaps by enabling inlineSources (ac74abd)

1.2.1 (2018-05-15)

Bug Fixes

  • core: CHECKOUT-3053 Fix TS import by adding types field in package.json (2423e26)

1.2.0 (2018-05-15)

Features

  • core: CHECKOUT-3053 Add TypeScript definitions (8a1bf13)

1.1.2 (2018-03-27)

1.1.1 (2017-11-20)

Bug Fixes

  • CHECKOUT-2645 Fix callback getting called prematurely (9a2a7ec)

1.1.0 (2017-05-10)

1.0.1 (2017-04-05)

Fixes

  • Remove bower.json as this package is not intended to be managed by Bower (094078e)

1.0.0 (2017-04-05)

Features

  • PAYMENTS-221 Post data as HTML form data (c0012a6)