今天在研究微信公众号接口问题,获取 access_token 一直报错:
[root@rbtnode2 /]# curl https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=填自己的appid&secret=填自己的appsecret
[1] 15961
[2] 15962
[root@rbtnode2 /]# {"errcode":41002,"errmsg":"appid missing hint: [utCCma0083hb97]"}
最后通过给 url 加上引号解决:
[root@rbtnode2 /]# curl https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=填自己的appid&secret=填自己的appsecret
{"access_token":"返回的token","expires_in":7200}