June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package handlers import ( "fmt" "net/http" ) // HelloHandler takes a GET parameter "name" and responds // with Hello <name>! in plaintext func HelloHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") if r.Method != http.MethodGet { w.WriteHeader(http.StatusMethodNotAllowed) return } name := r.URL.Query().Get("name") w.WriteHeader(http.StatusOK) ...Read now
Unlock full access