Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for dumpRequestOut (0.22 sec)

  1. src/net/http/httputil/dump_test.go

    		if tt.MustError {
    			req := freshReq(tt)
    			_, err := DumpRequestOut(req, !tt.NoBody)
    			if err == nil {
    				t.Errorf("DumpRequestOut #%d: expected an error, got nil", i)
    			}
    			continue
    		}
    
    		if tt.WantDumpOut != "" {
    			req := freshReq(tt)
    			dump, err := DumpRequestOut(req, !tt.NoBody)
    			if err != nil {
    				t.Errorf("DumpRequestOut #%d: %s", i, err)
    				continue
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 17:34:07 UTC 2022
    - 12.5K bytes
    - Viewed (0)
  2. src/net/http/httputil/dump.go

    		return 0
    	}
    	if req.ContentLength != 0 {
    		return req.ContentLength
    	}
    	return -1
    }
    
    // DumpRequestOut is like [DumpRequest] but for outgoing client requests. It
    // includes any headers that the standard [http.Transport] adds, such as
    // User-Agent.
    func DumpRequestOut(req *http.Request, body bool) ([]byte, error) {
    	save := req.Body
    	dummyBody := false
    	if !body {
    		contentLength := outgoingLength(req)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  3. src/net/http/httputil/example_test.go

    	req, err := http.NewRequest("PUT", "http://www.example.org", strings.NewReader(body))
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	dump, err := httputil.DumpRequestOut(req, true)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	fmt.Printf("%q", dump)
    
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 16 20:01:36 UTC 2022
    - 3.2K bytes
    - Viewed (0)
  4. src/net/http/requestwrite_test.go

    	}
    	if !sawGood {
    		t.Fatalf("writeCalls constant is outdated in test")
    	}
    }
    
    // dumpRequestOut is a modified copy of net/http/httputil.DumpRequestOut.
    // Unlike the original, this version doesn't mutate the req.Body and
    // try to restore it. It always dumps the whole body.
    // And it doesn't support https.
    func dumpRequestOut(req *Request, onReadHeaders func()) ([]byte, error) {
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 01:07:32 UTC 2022
    - 23.3K bytes
    - Viewed (0)
  5. internal/rest/client.go

    	origAuth := req.Header.Get("Authorization")
    	if origAuth != "" {
    		req.Header.Set("Authorization", "**REDACTED**")
    	}
    
    	// Only display request header.
    	reqTrace, err := httputil.DumpRequestOut(req, false)
    	if err != nil {
    		return
    	}
    
    	// Write request to trace output.
    	_, err = fmt.Fprint(c.TraceOutput, string(reqTrace))
    	if err != nil {
    		return
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  6. src/net/http/transport_test.go

    	req, _ := NewRequest("GET", "http://foo.com/", nil)
    	req.Method = ""                                 // docs say "For client requests an empty string means GET"
    	got, err := httputil.DumpRequestOut(req, false) // DumpRequestOut uses Transport
    	if err != nil {
    		t.Fatal(err)
    	}
    	if !strings.Contains(string(got), "GET ") {
    		t.Fatalf("expected substring 'GET '; got: %s", got)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*ServerConn).Pending", Method, 0},
    		{"(*ServerConn).Read", Method, 0},
    		{"(*ServerConn).Write", Method, 0},
    		{"BufferPool", Type, 6},
    		{"ClientConn", Type, 0},
    		{"DumpRequest", Func, 0},
    		{"DumpRequestOut", Func, 0},
    		{"DumpResponse", Func, 0},
    		{"ErrClosed", Var, 0},
    		{"ErrLineTooLong", Var, 0},
    		{"ErrPersistEOF", Var, 0},
    		{"ErrPipeline", Var, 0},
    		{"NewChunkedReader", Func, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  8. api/go1.txt

    pkg net/http/httptest, type Server struct, TLS *tls.Config
    pkg net/http/httptest, type Server struct, URL string
    pkg net/http/httputil, func DumpRequest(*http.Request, bool) ([]uint8, error)
    pkg net/http/httputil, func DumpRequestOut(*http.Request, bool) ([]uint8, error)
    pkg net/http/httputil, func DumpResponse(*http.Response, bool) ([]uint8, error)
    pkg net/http/httputil, func NewChunkedReader(io.Reader) io.Reader
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top