Set POST authorization header beforehand to avoid a first 401 response from server (which seems to confuse jquery in some cases)