Golang net/http.Head() function example

package net/http

Golang net/http.Head() function usage example

 package main

 import (
 "fmt"
 "net/http"
 )

 func main() {

 resp, err := http.Head("http://golang.org")

 if err != nil {
 fmt.Println(err)
 }

 fmt.Println("Status : ", resp.Status)

 }

output :

Status : 200 OK

Reference :

http://golang.org/pkg/net/http/#Head

Advertisement