is_wp_error is missing error

Both wp_remote_post and wp_remote_get return WP_Error object if there is an error. You could use the get_error_message function of WP_Error class to receive the error and show it.

$request = wp_remote_post( $url );
if ( is_wp_error( $request ) ) {
    // If the request has failed, show the error message
    echo $request->get_error_message();
} else {
    $content = wp_remote_retrieve_body( $request );
    // Do stuff with $content
}

For more details go ahead Here