Using http.NewRequest() to Improve the Client

Let’s enhance the HTTP web client by using the http.NewRequest() function.

We'll cover the following

In this lesson, we will learn how to read a URL without using the http.Get() function with more options. However, the extra flexibility comes at a cost because we must write more code.

Coding example

The code of wwwClient.go, without the import block, is as follows:

Get hands-on with 1200+ tech skills courses.