postman可以方便地發起http請求,但是如果要批量請求而且與其他腳本結合的時候,就需要使用命令行工具newman
安裝newman
- 使用npm安裝
npm install -g newman
- 查看已經安裝的應用以及版本
npm list --depth=0 -g
常用命令
newman run tenmao.postman_collection.json -e tenmao.postman_environment.json -g workspace.postman_globals.json -d people.txt > result.txt
查看常見參數
newman run -h
常見參數
-
-d
: 數據源 -
-g
: 全局變量 -
-e
: 環境變量