extracted functions RequestBasicAuth SendBasicAuthRequired