Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$secret = 'top_secret';
$url = 'https://example.com/wa-hook/abc123abc123
$parameters = ['foo' => 'bar'];
$args = ['headers' => []];
$args['body'] = json_encode($parameters);
$hash = hash_hmac('sha1', $args['body'], $secret);
$args['headers']['Content-Type'] = 'application/json; charset=utf-8';
$args['headers']['X_HUB_SIGNATURE'] = $hash;
$request = wp_remote_post($url, $args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.