As noted above in Sally CJ’s comment, and as seen in the Wp Codebase, those are protected properties, so they are meant to be accessed only through the multiple get
and set
methods that the class exposes:
/**
* Sets the header on request.
*
* @since 4.4.0
*
* @param string $key Header name.
* @param string $value Header value, or list of values.
*/
public function set_header( $key, $value ) {
$key = $this->canonicalize_header_name( $key );
$value = (array) $value;
$this->headers[ $key ] = $value;
}
// etc...
If you needed to access them directly, you would extend the class:
class MY_WP_REST_Request extends WP_REST_Request {
public $params;
// etc...
}
Though in my case, using the access methods provided is proving to be fine.
Related Posts:
- How to: Make JWT-authenticated requests to the WordPress API
- How would I add custom tables/endpoints to the WP REST API?
- WP REST API create post authentication issue
- WordPress REST API validation
- How to define a query parameter with REST API?
- How do I correctly setup an AJAX nonce for WordPress REST API?
- WordPress Rest API: How do we validate with our custom API key?
- Adding WordPress API Endpoint With Multiple Parameters
- Using the REST API (v2) javascript client on a private namespaced route
- authentication issue with rest api – rest_cannot_create
- Hiding API routes list
- Match REST API post output from custom endpoint
- How to change user avatar using REST API?
- Does accessing WordPress via REST API affect the site stats and analytics?
- x-wp-nonce is not allowed by Access-Control-Allow-Headers in preflight response
- How to get around WP REST API per page limit without pagination?
- Build on same WordPress or different install?
- Testing custom API endpoint with class dependency
- Not all featured image sizes available in Rest API
- WP API ignores filter parameter
- 403 Forbidden with gutenberg
- WordPress doesn’t send a notification email when submitting a comment using REST API
- Using WordPress RESTapi to call a php file instead of post or page
- Detect if REST API is running
- Using pre_get_posts, how to target the REST API, only?
- Save/update post_meta with Gutenberg from the panel
- Set featured image using URL with wp rest api
- How to block all REST API endpoint except which I wrote custom?
- Authentication with internal WP_REST_Request and rest_do_request()
- pagination in WP rest api
- How to use REST API to send user metadata?
- Can the new REST API now make WP into it’s own push notification server?
- Confused about AngularJS and WordPress
- Post API tax_relation field doesn’t work
- Cannot DIsplay a Snackbar Notice on Button Click – Notice is undefined
- How to post an unserialized array via wordpress rest API as meta data
- Custom Post Type and Custom REST API Endpoint result in Gutenberg editor not working
- rest_sanitize_value_from_schema doesn’t sanitize string
- Erratic OAuth 1.0 Signature Mismatch Errors
- No ‘Access-Control-Allow-Origin’ when call rest API
- WordPress Rest API custom endpoint for RSS feed
- How to add a custom REST field to limit data when fetching?
- Get subscribers via REST API and send post notification
- WordPress JSON data to and from database to be shown on rest point
- “No Access-Control-Allow-Origin header is present” even though it is in the entry file
- Allow “wp-admin” edit access through headless WP web application
- REST API authentication for a plugin
- rest api request including meta_query filter
- Rest API basic auth not working
- Error invalid parameters with REST API
- How to get featured image in WP rest api
- Filter DELETE REST API calls
- Rest API: wp_verify_nonce() fails despite receiving correct nonce value
- Update user meta via REST API?
- How to call wp plugin REST functions without curl?
- Disable part of endpoints wordpress api
- Get a term object using getEntityRecords
- Backbone with custom rest endpoints
- rest Api jwt authentication for get methodes
- Custom Endpoints not working
- Is there a way I can fetch the WordPress Developer Code References with an API?
- Pull in ALL posts from the last two weeks using Rest API
- How to add an endpoint to WP
- How to set up the REST API to refer to media on a CDN
- Cannot use WordPress Application Passwords: “code”: “rest_no_route” “status”:404 for /wp-json/wp/v2/users/me/application-passwords
- IIS Authorization Rules breaks WP REST-API and results in fail in Site Health
- How to delete all instances of the image using REST API
- register_rest_route with method POST but in wp-json/ is showing GET
- wp_nonce vs jwt
- Rest Api fetching only one random post
- WP REST API returns empty posts despite entries in wp_posts
- How to add taxonomy to a post using WP REST API?
- WP CLI in WP 5.3 with PHP 7.4
- The REST API encountered an error in wordpress?
- Do something when publish a post in Gutenberg with hook rest_after_insert_post
- Uploading picture via REST API
- How to modify the HTML output of Gutenberg block? (Youtube)
- Extract XML/JSON element from Zillow API response and populate into Gravity Forms field
- Can I use REST API if the site is protected with .htpasswd
- How can I secure my custom rest api endpoint or add under a already existing rest group
- WordPress single page website redirect to index.html
- How to get the most recently updated orders via the REST API?
- Fetching all users that didn’t post with rest api (current version 2)
- Calling a python script from custom wordpress rest api returns null
- Autotrader API Integration
- WordPress RESTAPI – Restrict unknown
- WordPress Rest API Error 502
- Fix Characters WordPress Ionic App
- Accessing secure endpoint with X-WP-Nonce?
- Return all custom taxonomy terms for post in REST API v2? Currently limited to 10 terms
- Can we use website data which is having wp rest api plugin?
- WP Rest API V2 OR Operator in URL
- Call to undefined function upload_is_user_over_quota()
- Rest api request throttling
- How can I set the default ‘orderby’ and ‘order’ parameters for a REST API call?
- Problem with custom WordPress Rest API search route with query parameters
- What filtering is available for backbone.js?
- How to limit what fields are returned through the WP API Backbone JS client
- Woocommerce API for calling products by Category ID
- wordpress rest api authentication failed