Added basic http authentication for cases where request format is not HTML (e.g. atom or xml)