First
This commit is contained in:
commit
e7cca80808
|
@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue