请求的接口是腾讯特殊字符检测:https://api.weixin.qq.com/wxa/msg_sec_check ruby 请求代码
uri = URI.parse("https://api.weixin.qq.com/wxa/msg_sec_check")
http = Net::HTTP.new(uri.host,uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.cert_store = OpenSSL::X509::Store.new
http.cert_store.set_default_paths
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({content: "好不好呢",access_token: access_token})
res = http.request(req)
Rails.logger.debug res.body
return JSON.parse(res.body)
返回错误信息:
↳ app/models/wechat_applet_manager.rb:41
Completed 500 Internal Server Error in 870ms (ActiveRecord: 1.8ms)
Zlib::DataError (incorrect header check):
app/models/wechat_applet_manager.rb:67:in `post_msg_sec_check'
求大神指导需要怎么处理