make Prettier (v2)

This commit is contained in:
AJ ONeal 2021-01-14 16:07:48 -07:00
parent 3574e35635
commit 9395ec96e3
11 changed files with 61 additions and 63 deletions

View File

@ -5,11 +5,9 @@ var request = require('../');
// will redirect to https://www.github.com and then https://github.com // will redirect to https://www.github.com and then https://github.com
//request('http://www.github.com', function (error, response, body) { //request('http://www.github.com', function (error, response, body) {
request({ uri: { protocol: 'http:', hostname: 'www.github.com' } }, function( request(
error, { uri: { protocol: 'http:', hostname: 'www.github.com' } },
response, function (error, response, body) {
body
) {
if (error) { if (error) {
console.log('error:', error); // Print the error if one occurred console.log('error:', error); // Print the error if one occurred
return; return;
@ -17,4 +15,5 @@ request({ uri: { protocol: 'http:', hostname: 'www.github.com' } }, function(
console.log('statusCode:', response.statusCode); // The final statusCode console.log('statusCode:', response.statusCode); // The final statusCode
console.log('Final href:', response.request.uri.href); // The final URI console.log('Final href:', response.request.uri.href); // The final URI
console.log('Body Length:', body.length); // body length console.log('Body Length:', body.length); // body length
}); }
);

View File

@ -4,11 +4,9 @@
var request = require('../'); var request = require('../');
// would normally redirect to https://www.github.com and then https://github.com // would normally redirect to https://www.github.com and then https://github.com
request({ uri: 'https://www.github.com', followRedirect: false }, function( request(
error, { uri: 'https://www.github.com', followRedirect: false },
response, function (error, response, body) {
body
) {
if (error) { if (error) {
console.log('error:', error); // Print the error if one occurred console.log('error:', error); // Print the error if one occurred
return; return;
@ -17,4 +15,5 @@ request({ uri: 'https://www.github.com', followRedirect: false }, function(
console.log('statusCode:', response.statusCode); // Should be 301 or 302 console.log('statusCode:', response.statusCode); // Should be 301 or 302
console.log('Location:', response.headers.location); // The redirect console.log('Location:', response.headers.location); // The redirect
console.log('Body:', body || JSON.stringify(body)); console.log('Body:', body || JSON.stringify(body));
}); }
);