Golang net/http.RedirectHandler() function example

package net/http

Golang net/http.RedirectHandler() function usage example

 package main 

 import ( 
 "net/http"
 )

 func main() {
 http.ListenAndServe(":8080", http.RedirectHandler("http://golang.org", 301))
 }

Reference :

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

Advertisement