<reponame>naushadnizarali/python-learning<filename>parse-resume/eden-io.js<gh_stars>0const axios = require('axios').default;
const fs = require("fs");
const FormData = require("form-data");

const form = new FormData();
form.append("providers", "affinda");
form.append("file", fs.createReadStream("/Volumes/MobileDev/python-learning/datasets/data/INFORMATION-TECHNOLOGY/10089434.pdf"));

const options = {
  method: 'POST',
  url: 'https://api.edenai.run/v2/ocr/resume_parser',
  headers: {
    Authorization: 'Bearer vqbpgud2ghvjgm1n5hdgjnn5818fzsf2thL36yc6r94LAk_29GUKxw7IqBQIyFHxr_lhdZcZxw4',
    'Content-Type': 'multipart/form-data; boundary=' + form.getBoundary()
  },
  data: form
};

axios
  .request(options)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.error(error);
  });