I am using the code below to call an API (for Harvest, a timekeeping web app). It works fine on my machine for two different users, but when run on a different machine, it does not work for either user. (And when I say "works," it returns a valid XML file of results on my machine, and on the other machine it returns an empty file with an authentication error message.) Both machines are on Excel 2010. Is there something machine-specific that could impact the encoding?
'Set up the HTTP headers so Harvest will interpret this as an API request.
httpReq.setRequestHeader "Content-Type", "application/xml"
httpReq.setRequestHeader "Accept", "application/xml"
httpReq.setRequestHeader "Authorization", "Basic " + Base64Encode(user + ":" + pass)
httpReq.send