Created
April 18, 2024 08:03
-
-
Save Cohee1207/10774c05392e1f15f0f5ceac2559e106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
const options = { | |
hostname: 'api.novelai.net', | |
port: 443, | |
path: '/', | |
method: 'GET', | |
}; | |
const req = https.request(options, (res) => { | |
const cert = res.socket.getPeerCertificate(); | |
console.log(cert); | |
res.on('data', (data) => { | |
// Handle response data | |
console.log(data.toString()); | |
}); | |
}); | |
req.on('error', (error) => { | |
console.error('An error occurred:', error); | |
}); | |
req.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment