Http.Get vs Http.NewRequest

Go - http.Get vs http.NewRequest

The difference between “http.Get” and http.NewRequest is that the second one allows us to get control over the HTTP heades.

Turned out that I had no idea about http.Get, I guess it has to do with the fact that everything I have worked with requires authentication, therefore additional headers in the HTTP requests are needed.

Official Go Documentation:

https://pkg.go.dev/net/http

 Share!

 
comments powered by Disqus