How to delete a user via REST
First you need to login:

$loginData = ['username' =&gt; 'yourusername', 'password' =&gt; 'yourpassword'];

$ch = curl_init("http://pathtodrupal.com/endpoint/user/login.json");

curl_setopt_array($ch, [
  CURL_OPT              =&gt; TRUE,
  CURLOPTRETURNTRANSFER =&gt; TRUE,
  CURLOPT_HTTPHEADER    =&gt; ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS    =&gt; json_encode($loginData),
]);

$response = curl_exec($ch);

$responseData = json_decode($response, TRUE);


Once you send a POST request to login you get the following response back:


  {u'session_name': u'SESScxx45656f30', u'sessid':
  u'mOE9NdG6Bk3EADSvKJHGGy8jgkQ', u'token':
  u'-HVkXhARIynpmJxow5NUIYTRXSc', u'user': {u'status': u'1', u'picture':
  u'0', u'uuid': u'514c987e7-15f0-43cc-9c6f-53279c216f30', u'uid': u'1',
  u'language': u'', u'created': u'1310006971', u'init':
  u'morinfo@dbasepu.com', u'timezone': u'America/New_York', u'access':
  u'1429109927', u'theme': u'', u'roles': {u'2': u'authenticated user'},
  u'signature': u'', u'signature_format': u'1', u'mail':
  u'mor@morinfo.com', u'login': 1429111638, u'data': {u'ckeditor_width':
  u'100%', u'form_build_id': u'form-60703ffc3';lk6c0fe03cebe9',
  u'ckeditor_lang': u'en', u'ckeditor_show_toggle': u't',
  u'last_category_id': 1, u'ckeditor_auto_lang': u't',
  u'ckeditor_default': u't', u'site_access': {u'1': u'1'},
  u'last_site_id': 1}, u'name': u'bewmrn'}}


In your subsequent requests you want set the the set in the header the X-CSRF-Token to $response['token'] and Cookie to $response['session_name'].=.$response['sessid']. This should work.