forked from wikimedia/mediawiki-api-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrsd.js
More file actions
25 lines (18 loc) · 591 Bytes
/
rsd.js
File metadata and controls
25 lines (18 loc) · 591 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//This file is autogenerated. See modules.json and autogenerator.py for details
/*
rsd.js
MediaWiki API Demos
Demo of `Rsd` module: Get request to export an RSD schema.
MIT License
*/
var url = "https://en.wikipedia.org/w/api.php";
var params = {
action: "rsd",
format: "json"
};
url = url + "?origin=*";
Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];});
fetch(url)
.then(function(response){return response.json();})
.then(function(response) {console.log(response);})
.catch(function(error){console.log(error);});