First
This commit is contained in:
19
main.go
Normal file
19
main.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
import "net/http"
|
||||
import "io"
|
||||
|
||||
func main() {
|
||||
fmt.Println("staring")
|
||||
|
||||
resp, err := http.Head("http://example.com")
|
||||
if err != nil {
|
||||
fmt.Println("Failed")
|
||||
} else {
|
||||
_, _ = io.ReadAll(resp.Body)
|
||||
resp.Body.Close()
|
||||
fmt.Println("status", resp.StatusCode)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user