downloads a file from a given URL and a given type for the result.
target URL
type of the result
Optional
optional headers
downloads a file from a given URL and a given type for the result.