Hi.
This is the good script to get categories:
<?php
require_once '../wp-includes/class-IXR.php';
$url='https://domain.com/xmlrpc.php';
$usr='USER';
$pas='PASSWORD';
$client = new IXR_Client($url);
$content= 'category';
$params= array(0,$usr,$pas,$content);
if(!$client->query('wp.getTerms',$params)){
die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage());
}
$respuesta=$client->getResponse();
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
header('Access-Control-Max-Age: 86400');
header('Access-Control-Allow-Credentials: true');
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
echo json_encode($respuesta);
?>
??