cURL

curl -s -X POST -H 'Content-Type: application/json' -d '{"name": "John Smith", "message": "I'm signing your guestbook!"}' https://api.greg.ca/guestbook/sign


PHP

$api_call = curl_init('https://api.greg.ca/guestbook/sign');
curl_setopt($api_call, CURLOPT_ENCODING, '');
curl_setopt($api_call, CURLOPT_MAXREDIRS, 10);
curl_setopt($api_call, CURLOPT_TIMEOUT, 30);
curl_setopt($api_call, CURLOPT_POSTFIELDS, '{"name": "John Smith", "message" : "I'm signing your guestbook!"}');
curl_setopt($api_call, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($api_call, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($api_call);
curl_close($api_call);


Python

requests.post(
    "https://api.greg.ca/guestbook/sign",
    json={"name": "John Smith", "message": "I'm signing your guestbook!"}
)