H::GET( $url, <$params> ) H::POST( $url, <$params> )
PARAMETERS
$url (string) - API Endpoint.
$params (array, optional) - Extra data
EXAMPLE
$result = H::GET( 'https://your-site.com/wp-json/wp/v1/sample-get/322' );
If most of your endpoints are from the same site, define a constant called API_URL. Now you can pass in only the relative path:
API_URL
// wp-config.php ... define( 'API_URL', 'https://your-site.com/wp-json/wp/v1' );
$result = H::GET( '/sample-get/322' ); H::POST( '/sample-post/322', [ 'name' => 'hrsetyono', 'website' => 'pixelstudio.id' ] );
There was an error while loading. Please reload this page.