简体   繁体   English

为什么我的Cloudflare Apps网络挂钩无法正常工作?

[英]Why my Cloudflare Apps web hooks not working?

I keep getting the following error message when implementing web hooks with cloudflare. 使用cloudflare实现Web挂钩时,我不断收到以下错误消息。

There was an error communicating with Trebble. 与Trebble通信时出错。

The dev console says: 开发控制台说:

raven.js:1 Hook failure 
    1. {type: "system", message: "unexpected end of JSON input", fields: Array(0)}
        1. fields:[]
        2. message:"unexpected end of JSON input"
        3. type:"system"
        4. __proto__:Object
raven.js:1 Error(s) triggering preview hook 
    1. [{…}]
    console.(anonymous function)    @   raven.js:1
    (anonymous) @   installs.coffee:53
    processQueue    @   angular.js:13318
    (anonymous) @   angular.js:13334
    $eval   @   angular.js:14570

You'll want to check the response from that endpoint is incorrect JSON format. 您需要检查来自该端点的响应是否为JSON格式不正确。 You can run a curl to the API endpoint to mock Cloudflare's web hook. 您可以对API端点运行curl来模拟Cloudflare的Web挂钩。

You can get the JSON by triggering the hook, then look in your dev tools for a URL like 您可以通过触发钩子来获取JSON,然后在开发工具中查找网址,例如

curl -vs "http://example.com/wordofday" --data {"event":"preview","install":{"id":"**","versionTag":null,"options":{},"schema":{"properties":{"location":{"title":"Message Location","description":"Where should the message appear?","order":0,"type":"object","format":"element","default":{"selector":"body","method":"prepend"}},"newopt_word":{"title":"Message","description":"A short example message.","type":"string","format":"richtext","order":1,"default":"<p>Welcome to Cloudflare Apps! This is our example app.</p><p>Download this app every time you want to make a new project.</p>"},"message":{"title":"Message","description":"A short example message.","type":"string","format":"richtext","order":1,"default":"<p>Welcome to Cloudflare Apps! This is our example app.</p><p>Download this app every time you want to make a new project.</p>"}}},"siteId":"preview","appId":"local","active":true,"metadata":{"userId":"**"}},"userId":"**"} -H "Accept:application/json, text/plain, */*" -H "content-type: application/json;charset=UTF-8"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM