Skip to content

Instantly share code, notes, and snippets.

<?php
function api_query($http_method, $method, array $req = array()) {
$key = '';
$secret = '';
$post_data = $http_method == 'POST' ? json_encode($req) : '';
$sign = hash_hmac('sha512', $post_data, $secret);
$headers = array(
'Content-type: application/json',