Skip to content

Instantly share code, notes, and snippets.

@microcoder-py
Last active January 31, 2022 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save microcoder-py/b3d36ea5dfd0a84135b82f55df2201ab to your computer and use it in GitHub Desktop.
Save microcoder-py/b3d36ea5dfd0a84135b82f55df2201ab to your computer and use it in GitHub Desktop.
var request = require('request')
var fs = require('fs')
const form_data = {'file': fs.createReadStream("./TestInvoice1.png") }
const options = {
url: 'https://app.nanonets.com/api/v2/OCR/Model/a2072fdb-6950-4c20-ab86-614358c035d6/LabelFile/',
formData: form_data,
headers: {
'Authorization': 'Basic ' + Buffer.from('{ADD_API_KEY}' + ':').toString('base64')
}
}
request.post(options, function (err, httpResponse, body) {
console.log(body)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment