背景
使用WxPusher微信推送服务 ,可以及时的将服务的一些运行异常信息,发送到自己的微信上,方便了解服务的运行状态(PS:这个服务是免费的)。
你可以在这里看到WxPusher微信推送服务的接入说明文档:https://wxpusher.zjiecode.com/docs/
你可以在这里体验他的功能:https://wxpusher.zjiecode.com/demo
真的非常好用,强烈推送用来发送提示消息。
问题
看到官方的接入文档,接入的时候,出现了错误:
{ "code": 1005, "msg": "服务器错误:Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported", "data": null, "success": false}
解决方案
为了分析这个错误,我们先来看一下完整的http请求的request:
header:
POST /api/send/message HTTP/1.1Content-Type: application/x-www-form-urlencodedUser-Agent: PostmanRuntime/7.26.5Accept: */*Postman-Token: 454412c5-4bb9-46ec-a8f9-ea74c6b9e02aHost: wxpusher.zjiecode.comAccept-Encoding: gzip, deflate, brContent-Length: 221Connection: keep-alive{ "appToken":"AT_xxx", "content":"测试内容", "summary":"消息摘要", "contentType":1, "to.........