微信小程序 请求返回:data format error hint

来源:互联网 发布:php get传递url 编辑:程序博客网 时间:2024/06/06 02:49

在发送模板消息时返回:47001 data format error hint 错误

原因一般是post请求的Json数据格式不对,可以用http://www.bejson.com校验一下。

另外我用的小程序自带的请求测试的,把 

header: {        'content-type': 'application/json'      },

这里改成默认的json,或者不写就请求成功了,

之前因为其他需求写成了:

header: {            "Content-Type": "application/x-www-form-urlencoded"          },
从而导致报错,Mark一下。


原创粉丝点击