@npm-polymer/iron-ajax
npm i @npm-polymer/iron-ajax
Deprecated!
Please use @polymer packages instead

@npm-polymer/iron-ajax

Easily make ajax requests

by PolymerElements

1.4.4 (see all)License:http://polymer.github.io/LICENSE.txtTypeScript:Not Found
npm i @npm-polymer/iron-ajax
Readme

Build status

Demo and API docs

<iron-ajax>

The iron-ajax element exposes network request functionality.

<iron-ajax
    auto
    url="https://www.googleapis.com/youtube/v3/search"
    params='{"part":"snippet", "q":"polymer", "key": "YOUTUBE_API_KEY", "type": "video"}'
    handle-as="json"
    on-response="handleResponse"
    debounce-duration="300"></iron-ajax>

With auto set to true, the element performs a request whenever its url, params or body properties are changed. Automatically generated requests will be debounced in the case that multiple attributes are changed sequentially.

Note: The params attribute must be double quoted JSON.

You can trigger a request explicitly by calling generateRequest on the element.

<iron-request>

iron-request can be used to perform XMLHttpRequests.

<iron-request id="xhr"></iron-request>
...
this.$.xhr.send({url: url, body: params});

Downloads/wk

9

GitHub Stars

128

LAST COMMIT

3yrs ago

MAINTAINERS

1

CONTRIBUTORS

76

OPEN ISSUES

52

OPEN PRs

6
VersionTagPublished
1.4.4
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial