温馨提示×

ubuntu postman怎么发送请求

小樊
49
2026-09-01 00:52:06
栏目: 智能运维

Ubuntu 上使用 Postman 发送请求,一般步骤如下(假设你已经安装好了 Postman):


一、打开 Postman

如果你是通过官方包安装的:

postman

或通过应用菜单搜索 Postman 打开。


二、发送一个基本请求(以 GET 为例)

  1. 点击左上角 “New” → “HTTP Request”
  2. 在请求方法下拉框中选择:
    • GET
    • POST
    • PUT
    • DELETE
  3. 在地址栏输入接口地址,例如:
    https://jsonplaceholder.typicode.com/posts
    
  4. 点击 Send
  5. 在下方 Response 区域查看返回结果

三、发送 POST 请求(带 JSON 参数)

  1. 方法选择 POST
  2. 输入 URL,例如:
    https://jsonplaceholder.typicode.com/posts
    
  3. 切换到 Body 标签
  4. 选择:
    • raw
    • 格式选 JSON
  5. 输入示例数据:
    {
      "title": "test",
      "body": "hello",
      "userId": 1
    }
    
  6. 点击 Send

四、设置请求头(Headers)

  1. 点击 Headers 标签
  2. 添加键值对,例如:
    Key: Content-Type
    Value: application/json
    

五、带鉴权(Authorization)

  1. 点击 Authorization
  2. 选择类型:
    • Bearer Token
    • Basic Auth
    • API Key
  3. 填写对应信息(如 Token)

六、环境变量(可选)

  1. 右上角点击 Environment → Add
  2. 添加变量,例如:
    base_url = https://api.example.com
    
  3. 请求中使用:
    {{base_url}}/users
    

七、常见问题(Ubuntu 特有)

1. Postman 打不开

尝试:

sudo apt install libnss3

2. 没有声音/字体异常

一般不影响请求发送。


如果你愿意,可以告诉我:

  • 你用的是 Postman 桌面版还是网页版
  • 想发送 什么类型接口(GET/POST/文件上传等)

我可以直接给你 具体示例

0