Skip to content

Instantly share code, notes, and snippets.

@Harsimran1
Last active March 8, 2021 17:32
Show Gist options
  • Save Harsimran1/7482648873496c85204c3336973cabc5 to your computer and use it in GitHub Desktop.
Save Harsimran1/7482648873496c85204c3336973cabc5 to your computer and use it in GitHub Desktop.
Simple http GET request
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