ajax-sender

1.3.1 • Public • Published

Ajax Sender (Demo)

Send AJAX requests easily

Doc

  • Installation

Simply import AjaxSender into your HTML.

<script src="https://unpkg.com/ajax-sender@1.2.1/AjaxSender.min.js"></script>	
  • How to use

Create a new AjaxSender object with the URL as the first parameter :

let ajax = new AjaxSender('https://your.url', options);
// OR using await
let data = await new AjaxSender('https://your.url', {
	...,
	wait: true
}).asPromise().send();
  • Options
{
	method: 'GET',
	data: { ... },
	responseType: 'json',
	wait: false, // Wait before sending the request ?
	headers: { ... },
	progress: response => { ... },
	load: response => { ... },
	error: response => { ... },
	uploadProgress: response => { ... },
	uploadLoad: response => { ... }
}
  • Methods

See the documentation for the method definitions.

  • Example

See this JSFiddle for a working example

Authors

/ajax-sender/

    Package Sidebar

    Install

    npm i ajax-sender

    Weekly Downloads

    50

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    1.07 MB

    Total Files

    45

    Last publish

    Collaborators

    • zenoo