Question : how to set status code golang http
Answered by : restu-wahyu-saputra
func ServeHTTP(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) w.Write([]byte("500 - Something bad happened!"))
}
Source : https://stackoverflow.com/questions/40096750/how-to-set-http-status-code-on-http-responsewriter | Last Update : Sat, 16 Oct 21
Question : how to set status code golang http
Answered by : restu-wahyu-saputra
rw.WriteHeader(http.StatusBadRequest)
Source : | Last Update : Sat, 16 Oct 21