订阅消息创建模板接口报404 not found,消息报文如下:
POST /wxaapi/newtmpl/addtemplate?access_token=27_VpgkGFMCRH4POv7rCHTHA2nQtmP_SjU7phjmm-fngDxLKkwO_P_VhGIejndzylgPcQ4oP7T7FnQnROBIZyOCH-pYk1HCQvFm1-WyyygMxU95oFH9O4VpkveZUU-Et1nFB5GyksWsB9OPpw-GTHXaAGDBPF HTTP/1.1 Host: api.weixin.qq.com Content-Length: 58 User-Agent: GuzzleHttp/6.2.1 curl/7.52.1 PHP/7.3.11-1+0~20191026.48+debian9~1.gbpf71ca0 Content-Type: application/x-www-form-urlencoded tid=861&kidList%5B0%5D=1&kidList%5B1%5D=2&kidList%5B2%5D=3 <<<<<<<< HTTP/1.1 404 Not Found Connection: keep-alive Content-Type: text/plain; charset=utf-8 Date: Thu, 14 Nov 2019 03:46:24 GMT Set-Cookie: wxuin=73703184529121; path=/; expires=Mon, 18 Jan 2038 19:14:07 GMT Strict-Transport-Security: max-age=15552000; includeSubDomains X-DNS-Prefetch-Control: off X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Content-Length: 9 Not Found -------- NULL [] [
我也是这个问题,已解决:
postData 格式是 x-www-form-urlencoded的;
这里有个坑,x-www-form-urlencoded 需要用key=value&key=value的格式发送,发送的是string型的数据;
所以传参需要转换下
http_build_query($data);
我这边试过没问题呢,可以贴一下测试代码吗?