Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleResponseRecorder (0.21 sec)

  1. src/net/http/httptest/example_test.go

    // license that can be found in the LICENSE file.
    
    package httptest_test
    
    import (
    	"fmt"
    	"io"
    	"log"
    	"net/http"
    	"net/http/httptest"
    )
    
    func ExampleResponseRecorder() {
    	handler := func(w http.ResponseWriter, r *http.Request) {
    		io.WriteString(w, "<html><body>Hello World!</body></html>")
    	}
    
    	req := httptest.NewRequest("GET", "http://example.com/foo", nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 2K bytes
    - Viewed (0)
Back to top