npm

Need private packages and team management tools?Check out npm Orgs. »

ajax-sender

1.2.2 • 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

install

npm i ajax-sender

Downloadsweekly downloads

41

version

1.2.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability