1 .json-server (2)

2018-06-06  本文已影响0人  Night_LION

// 获取所有用户信息
http://localhost:3000/users

//获取id为1的用户
http://localhost:3000/users/1

//获取公司的所有信息
http://localhost:3000/companies

//获取单个公司的信息
http://localhost:3000/companies/1

//获取所有公司ID为3的用户
http://localhost:3000/companies/1/users

//根据公司名字获取信息
http://localhost:3000/companies?name=Microsoft

//根据多个名字来获取公司的信息
http://localhost:3000/companies?name=Microsoft&name=Apple

//获取一页中只有两条数据
http://localhost:3000/companies?_page=1&_limit=2

//根据名字 升序排序asc desc降序
http://localhost:3000/companies?_sort=name&_order=asc

//获取年龄30及以上的用户
http://localhost:3000/users?age_gte=30

//获取年龄在30 到40之间的
http://localhost:3000/users?age_gte=30&age_lit=40

//搜索用户信息
http://localhost:3000/users?q=Henry

上一篇 下一篇

猜你喜欢

热点阅读