背景

上一节说到json-server mock数据,开启服务,我们可以获取数据。这一节,我们使用postman来获取数据,并且对数据进行CRUD操作。

postman介绍

postman是一款Http请求模拟工具,可以很方便的模拟get或者post或者其他请求来调试接口

如何使用

  • 下载安装
    直接官网下载,然后双击安装包安装即可(下载)

  • 具体使用
    使用上一节json-server 模拟的数据,进行处理

    1. get 获取数据
      使用Fetch API 实现学生信息的CRUD操作(2)---postman

    2. post 添加数据

      • 添加header
        使用Fetch API 实现学生信息的CRUD操作(2)---postman

      • 添加body,json格式一定要对
        使用Fetch API 实现学生信息的CRUD操作(2)---postman

    3. delete 删除数据
      使用Fetch API 实现学生信息的CRUD操作(2)---postman

    4. patch 修改数据(查了下,post/input/patch都可以做修改)
      使用Fetch API 实现学生信息的CRUD操作(2)---postman
      postman更多的安装和使用细节,大家可以看下参考链接????

参考链接

https://www.jianshu.com/p/97ba64888894
https://www.jianshu.com/p/46d44c09d94c
https://www.jianshu.com/p/556a7700004d
https://www.postman.com/

相关文章:

  • 2021-10-05
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-05-30
猜你喜欢
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2021-07-20
  • 2022-12-23
相关资源
相似解决方案