Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for ProtoMinor (0.36 sec)

  1. src/net/http/responsewrite_test.go

    	Raw  string
    }
    
    func TestResponseWrite(t *testing.T) {
    	respWriteTests := []respWriteTest{
    		// HTTP/1.0, identity coding; no trailer
    		{
    			Response{
    				StatusCode:    503,
    				ProtoMajor:    1,
    				ProtoMinor:    0,
    				Request:       dummyReq("GET"),
    				Header:        Header{},
    				Body:          io.NopCloser(strings.NewReader("abcdef")),
    				ContentLength: 6,
    			},
    
    			"HTTP/1.0 503 Service Unavailable\r\n" +
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 01:07:32 UTC 2022
    - 6.9K bytes
    - Viewed (0)
  2. src/net/http/response_test.go

    	return &Request{Method: method, Proto: "HTTP/1.1", ProtoMajor: 1, ProtoMinor: 1}
    }
    
    var respTests = []respTest{
    	// Unchunked response without Content-Length.
    	{
    		"HTTP/1.0 200 OK\r\n" +
    			"Connection: close\r\n" +
    			"\r\n" +
    			"Body here\n",
    
    		Response{
    			Status:     "200 OK",
    			StatusCode: 200,
    			Proto:      "HTTP/1.0",
    			ProtoMajor: 1,
    			ProtoMinor: 0,
    			Request:    dummyReq("GET"),
    			Header: Header{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 19:01:29 UTC 2024
    - 23.6K bytes
    - Viewed (0)
  3. src/net/http/readrequest_test.go

    			"abcdef\n???",
    
    		&Request{
    			Method: "GET",
    			URL: &url.URL{
    				Scheme: "http",
    				Host:   "www.techcrunch.com",
    				Path:   "/",
    			},
    			Proto:      "HTTP/1.1",
    			ProtoMajor: 1,
    			ProtoMinor: 1,
    			Header: Header{
    				"Accept":           {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    				"Accept-Language":  {"en-us,en;q=0.5"},
    				"Accept-Encoding":  {"gzip,deflate"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 14 22:23:32 UTC 2024
    - 10K bytes
    - Viewed (0)
  4. src/net/http/httptest/httptest_test.go

    	want := &http.Request{
    		Method:     "GET",
    		Host:       "example.com",
    		URL:        &url.URL{Path: "/"},
    		Header:     http.Header{},
    		Proto:      "HTTP/1.1",
    		ProtoMajor: 1,
    		ProtoMinor: 1,
    		RemoteAddr: "192.0.2.1:1234",
    		RequestURI: "/",
    	}
    	got.Body = nil // before DeepEqual
    	want = want.WithContext(context.Background())
    	if !reflect.DeepEqual(got, want) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 18:09:14 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  5. src/net/http/requestwrite_test.go

    	0: {
    		Req: Request{
    			Method: "GET",
    			URL: &url.URL{
    				Scheme: "http",
    				Host:   "www.techcrunch.com",
    				Path:   "/",
    			},
    			Proto:      "HTTP/1.1",
    			ProtoMajor: 1,
    			ProtoMinor: 1,
    			Header: Header{
    				"Accept":           {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    				"Accept-Charset":   {"ISO-8859-1,utf-8;q=0.7,*;q=0.7"},
    				"Accept-Encoding":  {"gzip,deflate"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 01:07:32 UTC 2022
    - 23.3K bytes
    - Viewed (0)
  6. src/net/http/httputil/dump_test.go

    	{
    		Req: &http.Request{
    			Method: "GET",
    			URL: &url.URL{
    				Scheme: "http",
    				Host:   "www.google.com",
    				Path:   "/search",
    			},
    			ProtoMajor:       1,
    			ProtoMinor:       1,
    			TransferEncoding: []string{"chunked"},
    		},
    
    		Body: []byte("abcdef"),
    
    		WantDump: "GET /search HTTP/1.1\r\n" +
    			"Host: www.google.com\r\n" +
    			"Transfer-Encoding: chunked\r\n\r\n" +
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 17:34:07 UTC 2022
    - 12.5K bytes
    - Viewed (0)
  7. src/net/http/response.go

    	return r.ProtoMajor > major ||
    		r.ProtoMajor == major && r.ProtoMinor >= minor
    }
    
    // Write writes r to w in the HTTP/1.x server response format,
    // including the status line, headers, body, and optional trailer.
    //
    // This method consults the following fields of the response r:
    //
    //	StatusCode
    //	ProtoMajor
    //	ProtoMinor
    //	Request.Method
    //	TransferEncoding
    //	Trailer
    //	Body
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  8. src/net/http/transfer.go

    		t.ProtoMajor = rr.ProtoMajor
    		t.ProtoMinor = rr.ProtoMinor
    		t.Close = shouldClose(t.ProtoMajor, t.ProtoMinor, t.Header, true)
    		isResponse = true
    		if rr.Request != nil {
    			t.RequestMethod = rr.Request.Method
    		}
    	case *Request:
    		t.Header = rr.Header
    		t.RequestMethod = rr.Method
    		t.ProtoMajor = rr.ProtoMajor
    		t.ProtoMinor = rr.ProtoMinor
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  9. src/net/http/alpn_test.go

    	}
    	line = strings.TrimSpace(line)
    	path := strings.TrimPrefix(line, "GET ")
    	if path == line {
    		return
    	}
    	req, _ := NewRequest("GET", path, nil)
    	req.Proto = "HTTP/0.9"
    	req.ProtoMajor = 0
    	req.ProtoMinor = 9
    	rw := &http09Writer{conn, make(Header)}
    	h.ServeHTTP(rw, req)
    }
    
    type http09Writer struct {
    	io.Writer
    	h Header
    }
    
    func (w http09Writer) Header() Header  { return w.h }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 3K bytes
    - Viewed (0)
  10. src/net/http/httptest/httptest.go

    	if err != nil {
    		panic("invalid NewRequest arguments; " + err.Error())
    	}
    	req = req.WithContext(ctx)
    
    	// HTTP/1.0 was used above to avoid needing a Host field. Change it to 1.1 here.
    	req.Proto = "HTTP/1.1"
    	req.ProtoMinor = 1
    	req.Close = false
    
    	if body != nil {
    		switch v := body.(type) {
    		case *bytes.Buffer:
    			req.ContentLength = int64(v.Len())
    		case *bytes.Reader:
    			req.ContentLength = int64(v.Len())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 18:09:14 UTC 2024
    - 2.6K bytes
    - Viewed (0)
Back to top