Skip to content

Instantly share code, notes, and snippets.

@woganmay
Created February 12, 2017 14:01
Show Gist options
  • Save woganmay/45be82fa42aaa8558995fef702f105bf to your computer and use it in GitHub Desktop.
Save woganmay/45be82fa42aaa8558995fef702f105bf to your computer and use it in GitHub Desktop.
<?php
// See: https://gist.github.com/woganmay/4c15a0f7c16e41ab3a3ea1a73c595bf9
$api_url = sprintf("https://my.flarum.site/api/users/%s/avatar", $user->id);
// See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf
$token = $session->token;
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Token ' . $token
]);
$result = curl_exec($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment