简体   繁体   中英

How do I download a CSV from a link using Node?

I need help downloading a CSV file which requires the user to be logged in. Here is the screen I'm on. The CSV file I'm interested in can be found at this link .

Any idea how I can download the CSV file from that link using Node?

Depending on the approach of the API that servers the CSV, there are several ways that you can authenticate your request.

The most common are:

  • BASIC , when you log with a username/password;
  • BEARER TOKEN , when you are already logged and has a token that represents your session;
  • API_KEY/CLIENT_KEY/AUTH_KEY... , when the service provides a key that will identify the request;

It seems that the website's API (JobNimbus) provides an API_KEY type of auth, you can see it here .

Follow the steps provided on the link to get your API key, and use the provided key to make the request using the fetch API or some library like axios .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM