> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Postman

> 使用 Postman 测试你的 REST API 调用

Postman 是测试 HTTP API 端点调用的绝佳工具。我们建议先使用 Postman，以便更方便地排查问题。

点击 "Run in Postman" 按钮，***在网页版 Postman 中 fork 一份***：

[![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/7602335-776bf0f9-c710-43cf-b3a2-7987801887f3?action=collection%2Ffork\&collection-url=entityId%3D7602335-776bf0f9-c710-43cf-b3a2-7987801887f3%26entityType%3Dcollection%26workspaceId%3Dcf2bf012-ff59-48a6-ba37-cf4864d2e43c)

Fork 之后，我们建议你免费[下载 Postman](https://www.postman.com/downloads/) 并在本地使用。
桌面版更稳定，功能也更丰富。

<Info>
  请务必在请求头中设置 `Authorization: Bearer API_Key` 值或 Profile Key。

  同时将环境变量 \{API\_Key} 设置为你的 API\_KEY。
</Info>

<Tip>
  **Postman 小贴士**

  <ul class="custom-bullets">
    <li> 你可以添加变量值，例如像 API\_KEY 这样的全局变量，让你在 Postman 中
    更容易发起 API 调用。有关如何进行该操作的更多详细信息，请参见 Postman 网站的[相关说明](https://learning.postman.com/docs/sending-requests/variables/variables/)。</li>
    <li>在 Postman 请求体（body）设为 x-www-form-urlencoded 时，你可以通过带 \[0] 后缀的 key 传数组。例如，要发送一条帖子，可以将 platforms\[0] 设为第一个值，platforms\[1] 设为第二个值。</li>
  </ul>
</Tip>

## 使用随机文本和图片进行测试

我们也建议你使用[随机文本和图片](/quickstart#publish-test-posts)进行测试，以免账户被社交网络封禁。

## 使用 Postman 自动生成 API 代码

你甚至可以在 Postman 中直接为大多数编程语言自动生成代码——Node.js、PHP、Python、C# 等等。视频中详细介绍了如何使用 Postman 并生成代码。

<div class="video-container">
  <iframe width="560" height="330" src="https://www.youtube.com/embed/T-ui_z2oyAU" title="Postman Auto Generate API Code" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</div>
