wechatpay-apiv3 / wechatpay-postman-script

微信支付 APIv3 的调试工具
Apache License 2.0
370 stars 343 forks source link

import josn script error . #9

Closed sytpb closed 3 years ago

sytpb commented 3 years ago

image

xy-peng commented 3 years ago

请提供一下postman的版本?

sytpb commented 3 years ago

8.0 不行,后来升级到8.1 也是一样的。

xy-peng commented 3 years ago

用这个方法试试 File/+号 -> import -> raw file

xy-peng commented 3 years ago

我试了下,可以导入的。

方法:点击 Import 选择Raw text,然后输入

curl --location --request https://raw.githubusercontent.com/wechatpay-apiv3/wechatpay-postman-script/master/wechatpay-apiv3.postman_collection.json

点击Continue

sytpb commented 3 years ago

image

sytpb commented 3 years ago

我试了用raw text 输入,但是还是报一个错,如上图。。

xy-peng commented 3 years ago

image 这样子不行?

sytpb commented 3 years ago

是的。我就这么干的。 复制 粘帖,continue 对吧?

xy-peng commented 3 years ago

输入框填curl命令,或者把下载后得到的json贴进去都可以。如果不行,看看是不是你的网关拦截了导致内容被修改了。

或者你使用的占位提示来测试下

curl --location --request GET http://postman-echo.com/get
sytpb commented 3 years ago

curl --location --request GET http://postman-echo.com/get 这个测试没有问题

xy-peng commented 3 years ago
curl --location --request GET https://raw.githubusercontent.com/wechatpay-apiv3/wechatpay-postman-script/master/wechatpay-apiv3.postman_collection.json

这样吧,可能是postman不同版本或者不同环境下使用的不同的curl版本有差别?GET是默认方法,漏掉method在我postman 8.1.0 macos上是可以的,可能你那边不行。

sytpb commented 3 years ago

image 这个可以了,但是我的collection 里怎么是空的?

xy-peng commented 3 years ago

囧,我搞错了!

方法1:还是老办法,导入文件

image

可以看到是这样子

image

方法2:把整个文件复制粘贴到raw text也可以。