Created
March 25, 2024 00:27
-
-
Save narenaryan/faaf5531da584e19aef2aa66a7921020 to your computer and use it in GitHub Desktop.
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 main | |
import ( | |
"fmt" | |
"net/http" | |
"time" | |
) | |
func main() { | |
client := &http.Client{Timeout: 5 * time.Second} | |
resp, err := client.Get("https://httpbin.org/get") | |
if err != nil { | |
fmt.Println(err) | |
return | |
} | |
fmt.Println(resp.StatusCode) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment