Hi Forum,
I have a simple form which updates an email address via a webhook action to an external api using the uniform plugin. The webhook seems to works fine but I like to see the entire request / json data being send. Is there a way I can dump the json data in php? This might be a simple question but I’m struggling to get this working.
controller.php
<?php
use Uniform\Form;
return function ($kirby, $page)
{
$form = new Form([
'email' => [
'rules' => ['required', 'email'],
'message' => 'Please enter a valid email address',
],
]);
if ($kirby->request()->is('POST')) {
$form->webhookAction([
'url' => 'https://super-secret.url/api',
'json' => true,
'params' => [
'method' => 'PUT',
'only' => ['email'],
'headers' => ['Authorization: Basic qwertzqwertz'],
],
]);
}
return compact('form');
};
Thanks in advance!