For basic, to work you need rest_auth to basic in your /application/config/rest.php
$config['rest_auth'] = 'basic';
then set username and password in the same file, to do this go to rest_valid_logins configuration in your /application/config/rest.php and set the key as the username and set the password as the value for that key. Remember it's an associate array so you can use multiple value key pairs.
$config['rest_valid_logins'] = ['admin' => '1234'];
Then make a call using HTTP basic authentication. To do that use the following format:
https://username:password@domain/path/to/api
For example, it could be
https://admin:1234@localhost/api/users