使用newman實現http批量請求

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: 環境變量

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章