小ネタです。
結論
Mac で試しましたが、以下のような形式で出力可能。
username/password は実際に値に置き換え下さい。
$echo "Basic $(echo -n 'username:passoword' | base64)"
あとはこれを Authorization ヘッダーに追加すればOK.
curl https://xxxxx -H 'Authorization: Basic MjhkdH
Postman を使うと GUI で直接ユーザー名・パスワード入力で Authorization ヘッダーの追加などもしてくれるのでこれを使うのもあり。
そもそも Basic 認証の手順とは
Basic 認証を通すためにはクライアントでは以下のようにする必要があります。
The username and password are combined with a single colon. (:)
The resulting string is encoded into an octet sequence.[7]
The resulting string is encoded using a variant of Base64.[8]
The authorization method and a space (e.g. "Basic ") is then prepended to the encoded string, separated with a space.
最終的にAuthorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
という文字列を作ります。