custom endpoint
-
I am using custom endpoint and i have also JWT token authorization and it uses post method :
https://localhost/mvc/wp-json/cargosite/v1/car-list-by-model
Here above API is using POST method and also using JWT token
How ever for a check i disabled jwt token but still it does not work. Here is my code which i place in functions.php
function wprc_add_acf_posts_endpoint( $allowed_endpoints ) {
if ( ! isset( $allowed_endpoints[ 'cargosite/v1' ] ) || ! in_array( 'car-list-by-model', $allowed_endpoints[ 'cargosite/v1' ] ) ) {
$allowed_endpoints[ 'cargosite/v1' ][] = 'car-list-by-model';
}
return $allowed_endpoints;
}
add_filter( 'wp_rest_cache/allowed_endpoints', 'wprc_add_acf_posts_endpoint', 10, 1);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘custom endpoint’ is closed to new replies.