Last active
March 8, 2021 17:32
-
-
Save Harsimran1/7482648873496c85204c3336973cabc5 to your computer and use it in GitHub Desktop.
Simple http GET request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package client | |
import ( | |
"net/http" | |
) | |
// makeRequest makes simple http request and returns a response string | |
func makeRequest() error { | |
resp, err := http.Get("https://medium.com") | |
if err != nil { | |
return err | |
} | |
defer resp.Body.Close() | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment