Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = 'https://pippinsplugins.com/edd-api/products';
- $username = '*******************'; //This is not necessary for this API
- $password = '****************'; //This is not necessary for this API
- $headers = array( 'Authorization' => 'Basic ' . base64_encode( "$username:$password" ) ); //This is not necessary for this API
- $request = wp_remote_get( $url, array( 'headers' => $headers ) );
- if(is_wp_error($request)) {
- return false;
- }
- $body = wp_remote_retrieve_body($request);
- $data = json_decode($body);
Add Comment
Please, Sign In to add comment