Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CancelRequest (0.1 sec)

  1. src/net/http/transport.go

    	}
    	t.reqCanceler[req] = cancel
    	t.reqMu.Unlock()
    	return cancel
    }
    
    // CancelRequest cancels an in-flight request by closing its connection.
    // CancelRequest should only be called after [Transport.RoundTrip] has returned.
    //
    // Deprecated: Use [Request.WithContext] to create a request with a
    // cancelable context instead. CancelRequest cannot cancel HTTP/2
    // requests. This may become a no-op in a future release of Go.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 91K bytes
    - Viewed (0)
  2. src/net/http/httputil/reverseproxy_test.go

    	defer frontend.Close()
    	frontendClient := frontend.Client()
    
    	getReq, _ := http.NewRequest("GET", frontend.URL, nil)
    	go func() {
    		<-reqInFlight
    		frontendClient.Transport.(*http.Transport).CancelRequest(getReq)
    	}()
    	res, err := frontendClient.Do(getReq)
    	if res != nil {
    		t.Errorf("got response %v; want nil", res.Status)
    	}
    	if err == nil {
    		// This should be an error like:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 54.6K bytes
    - Viewed (0)
Back to top