Moved headers into helper method as discussed

As per discussion with @agrieve I have moved the addition of the headers to the connection for both the upload and download methods to a helper method.