title: How to use Android Download manager with https?
body: <p>I was able to use DownloadManager to download HTTP request but I am unable to find any documentation/method regarding how can we use DownloadManager with HTTPS.</p>
  
  <pre><code>public long downloadFile(String fileUrl, String filename, String description, String token) {
      Uri uri = Uri.parse(fileUrl);
      DownloadManager.Request request = new DownloadManager.Request(uri);
      if (!TextUtils.isEmpty(filename))
          request.setTitle(filename);
      if (!TextUtils.isEmpty(description))
          request.setDescription(description);
  
      request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);
      request.allowScanningByMediaScanner();
      request.setVisibleInDownloadsUi(true);
      request.addRequestHeader("authorization", token);
      request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
      return mDownloadManager.enqueue(request);
  }
  </code></pre>