微信公众号开发中的错误

我是在本地调用 微信公众平台接口调试工具,获取token时出错,ip白名单中没有我本地的ip。我也只能从服务器上用curl

        200 OK

        Connection: close
        Date: Sat, 14-Dec-2019 07:56:29 GMT
        Content-Type: application/json; encoding=utf-8
        Content-Length: 77

        {
            "errcode": 40164, 
            "errmsg": "invalid ip*************6, not in whitelist"
        }

在服务器上顺利的获取到了access_token;

接下来的错误是40004 不合法的媒体文件类型

这个错误是因为Post提交时是json格式,用下面的就可以 了

 curl -H "Content-Type:application/json" -d '{"type":"news","offset":0,"count":20}' https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=access_token
...
原文地址:https://www.cnblogs.com/javage/p/12040201.html