weixin_39939510
2020-12-08 19:14 阅读 1

Webhook Results

Hi There, we use kirby-uniform with the webhook option. Right now the webhook hands back a simple integer, which is read and returned by $form->echoMessage() This works very good.

Now the question: How can a webhook trigger an error on uniform. Instead of the integer result, the error and its message is shown. Maybe this is just a question of missing documentation, maybe this is not implemented.

Feedback highly appreciated.

该提问来源于开源项目:mzur/kirby-uniform

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39795065 weixin_39795065 2020-12-08 19:14

    Currently the webhook action uses the remote::request() function from the Kirby Toolkit, which in turn uses the cURL extension to send the request. If a cURL error occurs, the output of curl_error gets passed through to be available by the message() function of Uniform.

    Unfortunately a response with a HTTP error code (e.g. 4xx) is not an error as far as cURL is concerned so the webhook action definitely can be improved here. But you can easily modify the action to shape it to your needs (you probably have done this already to return the integer response).

    点赞 评论 复制链接分享
  • weixin_39939510 weixin_39939510 2020-12-08 19:14

    On 23.06.2015 17:59, Martin Zurowietz wrote:

    Currently the webhook action uses the |remote::request()| function from the Kirby Toolkit, which in turn uses the cURL extension to send the request. If a cURL error occurs, the output of |curl_error| http://php.net/manual/en/function.curl-error.php gets passed through to be available by the |message()| function of Uniform.

    Unfortunately a response with a HTTP error code (e.g. |4xx|) is not an error as far as cURL is concerned so the webhook action definitely can be improved here. But you can easily modify the action to shape it to your needs (you probably have done this already to return the integer response).

    — Reply to this email directly or view it on GitHub https://github.com/mzur/kirby-uniform/issues/52#issuecomment-114556551.

    Thanks for your answer - we could use curl_error. I found your manual online, which was quite helpful - probably we move to a "native" function instead of the webhook. That seems to be the most common path to go.

    Moritz

    dipl.-ing. m.meinesz

    hydrosight corp. - lise meitner str. 14 - 46446 emmerich - germany

    点赞 评论 复制链接分享
  • weixin_39795065 weixin_39795065 2020-12-08 19:14

    probably we move to a "native" function instead of the webhook. That seems to be the most common path to go.

    Yeah, I still haven't found time to write a blogpost about developing custom actions... But there are a few examples by now. Keep me up to date if you develop a useful new action on the way ;-)

    点赞 评论 复制链接分享
  • weixin_39939510 weixin_39939510 2020-12-08 19:14

    On 23.06.2015 18:39, Martin Zurowietz wrote:

    
    probably we move to a "native" function instead of the webhook. That
    seems to be the most common path to go.
    

    Yeah, I still haven't found time to write a blogpost about developing custom actions... But there are a few examples by now. Keep me up to date if you develop a useful new action on the way ;-)

    — Reply to this email directly or view it on GitHub https://github.com/mzur/kirby-uniform/issues/52#issuecomment-114566260.

    Werden wir tun ;-) Mein Entwickler Chris will was mit Webhook/Json machen - Ich bin jetzt erst mal im Urlaub - schicken dir den Code zu, wenn es was allgemein verwertbares dabei rauskommt.

    Moritz

    dipl.-ing. m.meinesz

    hydrosight corp. - lise meitner str. 14 - 46446 emmerich - germany office tel: +49 2822 60 250 90 - 0 office fax: +49 2822 60 250 90 - 9

    点赞 评论 复制链接分享

相关推荐