用户 API(people)
完整的用户资料,带嵌套地址、地理坐标和公司,位于 /api/people。旧的 /api/user 端点是分开的。内存中的固定数据:写入会保留到应用重启为止。完整的用户资料,带嵌套地址、地理坐标和公司,位于 … … 端点是分开的。内存中的固定数据:写入会保留到应用重启为止。
你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。
- GET
https://api.testingapis.com/api/PeopleList people with filtering, sorting, search and paginationList people with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/PeopleCreate a personCreate a person. - GETHEAD
https://api.testingapis.com/api/People/{id}Get a person by IDGet a person by ID (HEAD returns the headers only). - PUT
https://api.testingapis.com/api/People/{id}Replace a personReplace a person. - PATCH
https://api.testingapis.com/api/People/{id}Partially update a person with a JSON merge patchPartially update a person with a JSON merge patch. - DELETE
https://api.testingapis.com/api/People/{id}Delete a personDelete a person. - POST
https://api.testingapis.com/api/People/bulkCreate up to 100 people in one requestCreate up to 100 people in one request. - DELETE
https://api.testingapis.com/api/People/bulkDelete several people by IDDelete several people by ID. - GET
https://api.testingapis.com/api/People/countCount all peopleCount all people.
请求示例
List people with filtering, sorting, search and pagination. 完整参考和 Send 按钮(英文).
cURL
curl -X GET "https://api.testingapis.com/api/People?limit=2"响应 · 200 OK
[
{
"id": 1,
"firstName": "Aisha",
"lastName": "Khan",
"username": "akhan",
"email": "akhan@example.com",
"gender": "female",
"dateOfBirth": "1991-04-12",
"phone": "+1-555-200-3000",
"avatar": "https://i.pravatar.cc/150?img=1",
"address": {
… (3 more lines)筛选、排序与分页
列表端点接受 limit、page、offset、sort、order 和 q,任何字段名都可用作精确筛选。总数通过 X-Total-Count 响应头返回。写入的数据在服务器重启前都保存在内存中,所以测试可以随意创建、修改和删除记录。 查询参数参考.