Added sendHeaders for compatibility with https connections and IE<9