Postman:Postman简介、安装、入门使用方法详细攻略

您所在的位置:网站首页 postman详细教程 Postman:Postman简介、安装、入门使用方法详细攻略

Postman:Postman简介、安装、入门使用方法详细攻略

2022-05-24 21:31| 来源: 网络整理| 查看: 265

Postman:Postman简介、安装、入门使用方法详细攻略

 

 

目录

Postman简介

Postman安装

Postman入门

1、图文教程

1.1、get案例

1.2、post案例

1.3、get案例

1.4、post案例

1.5、get案例

 

 

Postman简介

     开发API后,用于API测试的工具。在我们平时开发中,特别是需要与接口打交道时,无论是写接口还是用接口,拿到接口后肯定都得提前测试一下。在开发APP接口的过程中,一般接口写完之后,后端开发都会模拟调用一下请求。在用Postman之前,对于一般的get请求我基本都会用浏览器来简单模拟。而对于post请求,我一般习惯写代码来调用。可以用Java来模拟,当然用Python会更简洁。但是还有有很多弊端,不便于管理、维护困难等。Postman具有每个API开发人员的功能:请求构建,测试和预请求脚本,变量,环境和请求描述,旨在无缝地一起工作。

      这样的话就非常需要有一个比较给力的Http请求模拟工具,现在流行的这种工具也挺多的,像火狐浏览器插件-RESTClient,Chrome浏览器插件-Postman等等。这里主要介绍一下,一款模拟请求的利器Postman。

     Postman是一种网页调试与发送网页http请求的chrome插件。我们可以用来很方便的模拟get或者post或者其他方式的请求来调试接口。在Postman中,请求可以保存,也就类似于文件。而Collection类似文件夹,可以把同一个项目的请求放在一个Collection里方便管理和分享,Collection里面也可以再建文件夹。

 

 

Postman安装

官网地址:https://www.getpostman.com/downloads/    安装非常简单,下载直接安装即可!

1、此方法需要FQ,在安装时,最好是通过chrome浏览器打开chrome网上应用店直接添加到chrome插件中。如果是直接从网上先把postman下载好很可能按不到chrome上去。

 

 

Postman入门

相关文章:Postman:Postman(HTTP的测试工具)使用方法详细攻略

1、图文教程

1.1、get案例

http://localhost:5000/mine

{ "index": 2, "message": "New Block Forged", "previous_hash": "bcf967686847793897aab280b106ea30017c439aaeec21c9c7bd95472158268f", "proof": 12383, "transactions": [ { "amount": 1, "recipient": "b5ae874dc9324a128f4889f89e340112", "sender": "0" } ] } 1.2、post案例

http://localhost:5000/transactions/new

{ "sender": "b5ae874dc9324a128f4889f89e340112", "recipient": "someone else's address", "amount": 5 } { "message": "Transaction will be added to Block 3" }

1.3、get案例

http://localhost:5000/chain

{ "chain": [ { "index": 1, "previous_hash": "1", "proof": 100, "timestamp": 1523154040.807251, "transactions": [] }, { "index": 2, "previous_hash": "bcf967686847793897aab280b106ea30017c439aaeec21c9c7bd95472158268f", "proof": 12383, "timestamp": 1523154095.569124, "transactions": [ { "amount": 1, "recipient": "b5ae874dc9324a128f4889f89e340112", "sender": "0" } ] } ], "length": 2 }

pipenv run python blockchain.py pipenv run python blockchain.py -p 5001

 

1.4、post案例

{ "nodes":["http://127.0.0.1:5001"] } { "message": "New nodes have been added", "total_nodes": [ "127.0.0.1:5001" ] }

 

1.5、get案例

 

参考博文API  自动化测试利器——Postman

 

 

文章来源: yunyaniu.blog.csdn.net,作者:一个处女座的程序猿,版权归原作者所有,如需转载,请联系作者。

原文链接:yunyaniu.blog.csdn.net/article/details/79845141



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3