Solution 2: Building Web Services
Let’s solve the challenge set in the previous lesson.
We'll cover the following
Solution
To modify the wwwClient.go
program to save the HTML output to an external file output.html
, we can simply open the file, write the response data to the file, and then close the file.
After executing the code, we can copy and paste the command below in the terminal window to check the contents of the output.html
file:
Get hands-on with 1400+ tech skills courses.