Skip to content

Commit 8597c11

Browse files
committed
新增 Articut_JavaScript.js 範例
1 parent 6ea2c36 commit 8597c11

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var url = "https://api.droidtown.co/Articut/API/";
2+
3+
var xhr = new XMLHttpRequest();
4+
xhr.open("POST", url);
5+
6+
xhr.setRequestHeader("Accept", "application/json");
7+
xhr.setRequestHeader("Content-Type", "application/json");
8+
9+
xhr.onreadystatechange = function () {
10+
if (xhr.readyState === 4) {
11+
console.log(xhr.status);
12+
console.log(xhr.responseText);
13+
}};
14+
15+
var data = `{
16+
"username":"",
17+
"api_key" :"",
18+
"input_str":"我想過過過兒過過的日子"}`;
19+
20+
xhr.send(data);

0 commit comments

Comments
 (0)