为什么我和同学在 postman 使用同样的 API 测试却有不同的结果?

147 天前
 Fffys

504 的错误(都是 timeout ):

Status code | AssertionError: expected response to have status reason 'OK' but got 'CONNECTION TIMED OUT'
JSON response | AssertionError: expected response body to be a valid json but got error Unexpected token '<' at 1:1
Body Values | JSONError: Unexpected token '<' at 1:1 <HEAD><TITLE>Connection Timed Out</TITLE></HEAD> ^
Subscription Field | JSONError: Unexpected token '<' at 1:1 <HEAD><TITLE>Connection Timed Out</TITLE></HEAD> ^
Account type Field | JSONError: Unexpected token '<' at 1:1 <HEAD><TITLE>Connection Timed Out</TITLE></HEAD> ^

409 的错误:

Status code | AssertionError: expected response to have status reason 'OK' but got 'CONNECTION TIMED OUT'
JSON response | AssertionError: expected response body to be a valid json but got error Unexpected token '<' at 1:1
Body Values | JSONError: Unexpected token '<' at 1:1 <HEAD><TITLE>Connection Timed Out</TITLE></HEAD> ^
Subscription Field | JSONError: Unexpected token '<' at 1:1 <HEAD><TITLE>Connection Timed Out</TITLE></HEAD> ^
Account type Field | JSONError: Unexpected token '<' at 1:1 <HEAD><TITLE>Connection Timed Out</TITLE></HEAD> ^

我的环境:

同学的环境:

第一次发帖,如果需要提供更多内容会截图的,拜托了!

1219 次点击
所在节点    前端开发
3 条回复
yuanmomo
147 天前
选一个 api ,导出成 curl ,然后加上-v 的参数,debug 看看,是不是连了同一个服务器,然后对比一下两个机器的日志差异先。
superrichman
147 天前
你开了代理,他没开代理
Fffys
112 天前
最后,依然不知道问题在哪里,但是换了个网络环境就没有问题了,看来还是网络原因……后来我们做了网速测试,发现我平常的网络环境 gitter 很大但是同学的就很小

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1003683

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX