title: axios The "url" argument must be of type string. Received type undefined error
body: <p>Im working on an electron app that is trying to download a photo from the unsplash API and set it as a wallpaper. When I call the API I get 200 OK status and get the download URL, but when I try to download the photo with the axios stream method I get the following error: </p>
  
  <blockquote>
    <p>UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]:
    The "url" argument must be of type string. Received type undefined</p>
  </blockquote>
  
  <p>this is the function code:</p>
  
  <pre><code>ipcMain.on("getRandomWallpaper", async event =&gt; {
    const randomApi = `${apiGateway}/?client_id=${unsplashKey}`;
    const request = await axios({
      method: "get",
      url: randomApi
    });
    if (request.status === 200) {
      const downloadUrl = request.data.links.download;
      const imagePath = "./images";
      const download_image = async (downloadUrl, imagePath) =&gt; {
        await axios({
          downloadUrl,
          responseType: "stream"
        }).then(
          response =&gt;
            new Promise((resolve, reject) =&gt; {
              response.data
                .pipe(fs.createWriteStream(imagePath))
                .on("finish", () =&gt; resolve())
                .on("error", e =&gt; reject(e));
            })
        );
      };
      download_image(downloadUrl, imagePath);
    } else {
      const status = request.status;
      console.error(`${status}: \n Something went wrong...`);
    }
  });
  </code></pre>
  
  <p>When I tried to console.log the downloadUrl parameter inside the function it printed a value. Also I did</p>
  
  <pre><code> console.log(typeoff(downloadUrl))
  </code></pre>
  
  <p>and it printed string.
  I hope you can help me, 
  thanks in advance.</p>