Untitled
unknown
plain_text
2 years ago
628 B
3
Indexable
const axios = require('axios'); // Replace these values with your cPanel and website details const cPanelUsername = 'your_cpanel_username'; const cPanelPassword = 'your_cpanel_password'; const websiteUrl = 'https://yourwebsite.com'; // Create a basic HTTP authentication header const authHeader = { auth: { username: cPanelUsername, password: cPanelPassword, }, }; // Make an HTTP GET request to the website axios.get(websiteUrl, authHeader) .then(response => { console.log('Website content:', response.data); }) .catch(error => { console.error('Error accessing the website:', error.message); });
Editor is loading...
Leave a Comment