The Go standard library comes with excellent support
for HTTP clients and servers in the
net/http
package. In this example we’ll use it to issue simple
HTTP requests.
packagemain
import("bufio""fmt""net/http")
funcmain(){
Issue an HTTP GET request to a server.
http.Get
is a
convenient shortcut around creating an
http.Client
object and calling its
Get
method; it uses the
http.DefaultClient
object which has useful default
settings.