Request - Simplified HTTP client
Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.
request
// https://www.npmjs.com/package/request
const request = require('request')
/* --- */
request( 'https://example.com', function ( error, response, body ) {
/*
Print the error if one occurred
*/
console.error( `error: ${error}` )
/*
Print the response status code if a response was received
*/
console.log( 'statusCode:', response && response.statusCode)
/*
Print the HTML for the example homepage
*/
console.log( `body: ${body}` )
} )
Top comments (0)