Skip to content

Instantly share code, notes, and snippets.

@Carlos-Augusto
Last active October 31, 2021 06:34
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 Carlos-Augusto/3c568768a4a26a99f57fcfc205cdfd6c to your computer and use it in GitHub Desktop.
Save Carlos-Augusto/3c568768a4a26a99f57fcfc205cdfd6c to your computer and use it in GitHub Desktop.
'use strict';
const request = require('request');
const fs = require('fs');
const cert = fs.readFileSync(__dirname + "/test.pem", "utf8");
const keyFile = fs.readFileSync(__dirname + "/test.key", "utf8");
const options = {
method: 'POST',
url: 'https://api.uve.demo.ubirch.com/api/uve/v1/verify',
headers: {
"content-type": "application/json",
"X-Transaction-Id": "1234",
},
agentOptions: {
key: keyFile,
cert: cert,
},
body: "HC1:XXXXX"
};
request(options, (error, response, body) => {
console.log(error, "Errors");
console.log(response, "Response");
console.log(body, "Body");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment