VS Code 使用 Thunder 客户端?停止!这是满足您的 API 测试需求的理想扩展

来源:undefined 2025-02-14 01:23:02 1031

echoapi:无需离开 vs code 的终极 api 测试工具

使用 echoapi,您可以直接从代码编辑器测试您的 api。您可以保存请求集合,并在需要时重新访问(无论是一天还是一个月后)。另外,您可以将集合导出为 json 文件,以便与您的团队共享或供将来使用。

echoapi是一款支持scratch pad的超轻量级api开发协作工具。它是 postman 的绝佳替代品,为您提供 api 设计、调试、自动化测试和负载测试等功能。它还与 intellij idea、vs code 甚至 chrome 请求捕获扩展集成,所有这些都不需要登录。

无需登录 支持便签本 超轻量 100% 兼容 postman 脚本语法

echoapi 入门

要使用 echoapi 扩展,请单击操作栏上的 echoapi 图标。在侧边栏中,点击“新建请求”按钮来测试您的 api。

假设您需要使用以下详细信息测试 api:

1

2

3

4

5

6

url: https://httpbin.org/anything

method: post

content: {

"username": "admin",

"password": "password"

}

登录后复制

只需将此信息输入 echoapi 请求表单,您就可以启动请求了。

生成代码片段

echoapi 还可以为 curl 命令、javascript axios 和其他选项生成代码片段。以下是 echoapi 中 jwt auth 请求的 curl 命令的样子:

1

2

3

4

5

6

7

8

curl -x post

https://httpbin.org/anything

--header accept: */*

--header content-type: application/json

--data {

"username": "admin",

"password": "password"

}

登录后复制

这是一个 javascript axios 请求:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

import axios from "axios";

const options = {

method: post,

url: https://httpbin.org/anything,

headers: {

accept: */*,

content-type: application/json,

accept-encoding: gzip, deflate, br,

user-agent: echoapiruntime/1.1.0,

connection: keep-alive

},

data: {username: admin, password: password}

};

axios.request(options).then(function (response) {

console.log(response.data);

}).catch(function (error) {

console.error(error);

});

登录后复制

导入卷曲

您还可以将 curl 请求导入 echoapi,echoapi 会自动为您创建请求。然后,使用格式按钮格式化 json 或 xml 内容。

例如,从jasmin短信网关导入curl请求:

1

2

3

4

5

6

7

8

9

10

11

12

13

curl -X POST

https://httpbin.org/anything

--header Accept: */*

--header Authorization: Basic Zm9vOmJhcg==

--header Content-Type: application/json

--data {

"to": 19012233451,

"from": "Jookies",

"content": "Hello",

"dlr": "yes",

"dlr-url": "http://192.168.202.54/dlr_receiver.php",

"dlr-level": 3

}

登录后复制

以上就是VS Code 使用 Thunder 客户端?停止!这是满足您的 API 测试需求的理想扩展的详细内容,更多请关注php中文网其它相关文章!

最新文章