Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set( 'display_errors', "1" );
- ini_set( 'error_reporting', E_ALL | E_STRICT );
- $start = microtime(true);
- $c = curl_init( 'https://dashboard.wordpress.com/wp-admin/index.php' );
- curl_setopt_array( $c, array(
- CURLOPT_HTTPHEADER => array(
- 'Authorization: Bearer 123',
- ),
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_HEADER => false,
- ) );
- $response = curl_exec( $c );
- if ( false !== stripos( $response, 'authorization_required' ) ) {
- // WordPress.com didn't see an Authorization header
- echo "ERROR: No Authorization header was sent\n";
- exit( 1 );
- }
- echo "SUCCESS: An Authoraziton header was sent after " . ((microtime(true) - $start)) . " seconds\n";
- echo "Response: " . print_r($response, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement