Changeset 3372673
- Timestamp:
- 10/04/2025 02:29:05 AM (5 months ago)
- File:
-
- 1 edited
-
pkl-wpz-rest-api-auth/trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pkl-wpz-rest-api-auth/trunk/readme.txt
r3372670 r3372673 70 70 Example 1: Get Posts 71 71 72 ``php 73 $response = wp_remote_get( 'https://yoursite.com/wp-json/wp/v2/posts', array( 72 $response = wp_remote_get( 'https://yoursite.com/wp-json/wp/v2/posts', array( 74 73 'headers' => array( 75 74 'Authorization' => 'Bearer YOUR_API_KEY' … … 77 76 ) ); 78 77 79 if ( ! is_wp_error( $response ) ) {80 $data = json_decode( wp_remote_retrieve_body( $response ) );81 }82 83 78 Example 2: Create Post 84 79 85 ``php86 <?php87 80 $response = wp_remote_post( 'https://yoursite.com/wp-json/wp/v2/posts', array( 88 81 'headers' => array(
Note: See TracChangeset
for help on using the changeset viewer.