wechatpay-apiv3/wechatpay-postman-script

import josn script error .

sytpb opened this issue · 13 comments

sytpb commented

image

请提供一下postman的版本?

sytpb commented

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

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

我试了下,可以导入的。

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

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

点击Continue

sytpb commented

image

sytpb commented

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

image
这样子不行?

sytpb commented

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

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

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

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

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

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

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

囧,我搞错了!

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

image

可以看到是这样子

image

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