在 Linux 下使用 Postman 发送请求,你可以按照以下步骤操作:
wget
命令下载 Postman CLI 工具的最新版本:wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
tar -xzf postman.tar.gz
cd Postman
./Postman
.bashrc
文件:vi ~/.bashrc
向文件末尾添加以下代码并保存:
export PATH=$PATH:/opt/Postman
重新加载 .bashrc
文件:
source ~/.bashrc
在终端中输入 postman
并回车,这将启动 Postman 应用。
postman request get --url "https://api.example.com" --headers "Authorization: Bearer {token}" --output "response.json"
Content-Type: application/json
。以上就是在 Linux 下使用 Postman 发送请求的基本步骤。你可以根据自己的需求调整请求类型、URL 和请求体等参数。