forked from Tencent/APIJSON
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplex.html
More file actions
34 lines (33 loc) · 1 KB
/
complex.html
File metadata and controls
34 lines (33 loc) · 1 KB
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
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>GET:Complex</title>
<script type="text/javascript" src="../apijson.js">
</script>
</head>
<body>
<script >
//貌似在JavaScript里JSON注释前不能多于一个空格,否则不能解析
var json = {
"[]":{ //请求一个数组
"page":0, //数组条件
"count":2,
"Moment":{
"content$":"%a%" //对象条件,搜索content中包含 "a" 的动态
},
"User":{ //请求一个名为User的对象
"id@":"/Moment/userId", //缺省依赖路径,从所处容器的父容器路径开始
"@column":"id,name,head" //指定返回字段
},
"Comment[]":{ //请求一个名为Comment的数组,并去除Comment包装
"count":2,
"Comment":{
"momentId@":"[]/Moment/id" //完整依赖路径
}
}
}
};
request(url_get, json);
</script>
</body>
</html>