HTTP Client GET https
NodeJS
Hard
6 views
Problem Description
Send a GET request using https and print status code.
Output Format
Print status code.
Constraints
Use https.get and handle errors.
Official Solution
const https = require('https');
https.get('https://example.com', (res) => {
console.log(res.statusCode || 0);
res.resume();
}).on('error', () => {
console.log(0);
});
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!