now handles https, has a bug with expected length stream and compressed results