Put the pieces of code in the correct order to make an HTTP request and read the body of the response.
Making HTTP requests
Sort problem
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
if err != nil { log.Fatalln("can't read response") }
response, err := http.Get("https://httpbin.org/get")
if err != nil { log.Fatalln("can't do request") }
response.Body.Close()
body, err := io.ReadAll(response.Body)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.