func testHandler(w http.ResponseWriter, r *http.Request) {
// Set the Content-Length header
fmt.Println("\n\n=======================")
w.Header().Set("Content-Length", "12240")
// Set other headers if necessary
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(200)
fmt.Println("header has been set")
// Flush the headers
if flusher, ok := w.(http.Flusher); ok {
flusher.Flush()
fmt.Println("header has been flushed")
}
w.Write([]byte("1"))
fmt.Println("body has been written")
// Wait for 20 seconds
time.Sleep(30 * time.Second)
// Write the body
w.Write([]byte("1"))
fmt.Println("body has been written")
}