wp rest api v2 return json_no_route

OK, i find my answer. Just ask it here and as dear Charles sayed, they answered me, so fast, the answer is: By default, WP-API v1 takes priority over v2. If v1 is installed and activated, then v2 routes are inaccessible. To mitigate this, you’ll need to register either v1 or v2 to a different … Read more

How do I access the body of a WP API request in a custom route?

You can use $request->get_json_params() which will return an array of key => values. With these conditions(possibly a few more): The client sending the request has Content-Type: application/json in the header There is a raw body like {“option”:”siteColor”,”value”:”ff0000″}. https://developer.wordpress.org/reference/classes/wp_rest_request/get_json_params/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)