what is difference between http.get( ) method and var request = require('request')

I am new to the node JS ,In the nodeJS exercise no.8 of learnyounode ,my solution produces the same require result.I am confused when to use http.get and Request

goal:
Write a program that performs an HTTP GET request to a URL provided to you
as the first command-line argument. Collect all data from the server (not
just the first “data” event) and then write two lines to the console
(stdout).

The first line you write should just be an integer representing the number
of characters received from the server. The second line should contain the
complete String of characters sent by the server.

official solution

var http = require('http')
var bl = require('bl')

http.get(process.argv[2], function (response) {
    response.pipe(bl(function (err, data) {
        if (err)
            return console.error(err)
        data = data.toString()
        console.log(data.length)
        console.log(data)
    }))
})

my solution

var request=require('request')
request(process.argv[2],function(err,response,body){
console.log(body.length);
console.log(body);
})

From nodeJS documentation:

Since most requests are GET requests without bodies, Node.js provides
this convenience method. The only difference between this method and
http.request() is that it sets the method to GET and calls req.end()
automatically. Note that response data must be consumed in the
callback for reasons stated in http.ClientRequest section.

So, what exactly that means, is that you could do it your way without any problem. But request is not a module shipped with node itself, it is a module to make http(s) requests easier on the developers. So I’m guessing here, that you are learning NodeJS and not using third-parties should be the way to go.

I’m not familiar with request but it’s seems like it’s just a npm package that wraps the functionality of the standard library. You can use both but I would suggest reading through the documentation of http.get and request and if you find the standard library function (http.get) sufficient for your needs I don’ t see a reason you should use the request package.