Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 40 for StatusOK (0.17 sec)

  1. pkg/http/get.go

    	}
    	for k, v := range headers {
    		req.Header.Set(k, v)
    	}
    
    	response, err := httpClient.Do(req)
    	if err != nil {
    		return nil, err
    	}
    	defer response.Body.Close()
    
    	if response.StatusCode != http.StatusOK {
    		return nil, fmt.Errorf("unexpected status %d", response.StatusCode)
    	}
    
    	var b bytes.Buffer
    	if _, err := io.Copy(&b, response.Body); err != nil {
    		return nil, err
    	}
    	return &b, nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Aug 09 03:52:10 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  2. src/cmd/go/internal/web/http.go

    			fileErr:    err,
    		}, nil
    	}
    
    	if err != nil {
    		return nil, err
    	}
    
    	return &Response{
    		URL:        u.Redacted(),
    		Status:     http.StatusText(http.StatusOK),
    		StatusCode: http.StatusOK,
    		Body:       f,
    	}, nil
    }
    
    func openBrowser(url string) bool { return browser.Open(url) }
    
    func isLocalHost(u *urlpkg.URL) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 10 17:34:27 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  3. internal/http/response-recorder.go

    func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder {
    	rf, _ := w.(io.ReaderFrom)
    	return &ResponseRecorder{
    		ResponseWriter: w,
    		ReaderFrom:     rf,
    		StatusCode:     http.StatusOK,
    		StartTime:      time.Now().UTC(),
    	}
    }
    
    // ErrNotImplemented when a functionality is not implemented
    var ErrNotImplemented = errors.New("not implemented")
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 02 00:13:19 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  4. src/net/http/pprof/testdata/delta_mutex.go

    	req := httptest.NewRequest("GET", "/debug/pprof/mutex?seconds=1", nil)
    	rec := httptest.NewRecorder()
    	rec.Body = new(bytes.Buffer)
    
    	h.ServeHTTP(rec, req)
    	resp := rec.Result()
    	if resp.StatusCode != http.StatusOK {
    		log.Fatalf("Request failed: %s\n%s", resp.Status, rec.Body)
    	}
    
    	fmt.Print(rec.Body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 07 19:52:28 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  5. docs/auditlog/auditlog-echo.go

    		return
    	}
    
    	log.Printf(">>> %s %s\n", r.Method, r.URL.Path)
    	var out bytes.Buffer
    	json.Indent(&out, body, "", "    ")
    	log.Printf("%s\n", out.String())
    
    	w.WriteHeader(http.StatusOK)
    }
    
    func main() {
    	flag.Parse()
    	http.HandleFunc("/", mainHandler)
    
    	log.Printf("Listening on :%d\n", port)
    	log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), nil))
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 21:31:13 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  6. docs/iam/identity-manager-plugin.go

    		return
    	}
    
    	rsp, ok := tokens[token]
    	if !ok {
    		w.WriteHeader(http.StatusForbidden)
    		return
    	}
    
    	fmt.Printf("Allowed for token: %s user: %s\n", token, rsp.User)
    
    	w.WriteHeader(http.StatusOK)
    	json.NewEncoder(w).Encode(rsp)
    	return
    }
    
    func main() {
    	http.HandleFunc("/", mainHandler)
    
    	log.Print("Listening on :8081")
    	log.Fatal(http.ListenAndServe(":8081", nil))
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 21:31:13 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go

    		w.WriteHeader(http.StatusNotModified)
    		return
    	}
    
    	responsewriters.WriteObjectNegotiated(
    		serializer,
    		DiscoveryEndpointRestrictions,
    		targetGV,
    		w,
    		req,
    		http.StatusOK,
    		object,
    		true,
    	)
    }
    
    func calculateETag(resources interface{}) (string, error) {
    	serialized, err := json.Marshal(resources)
    	if err != nil {
    		return "", err
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 18:15:22 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  8. cni/pkg/plugin/cnieventclient.go

    	response, err = cniClient.client.Post(cniClient.url, "application/json", bytes.NewBuffer(eventData))
    	if err != nil {
    		return err
    	}
    	defer response.Body.Close()
    
    	if response.StatusCode != http.StatusOK {
    		return fmt.Errorf("unable to push CNI event, error was %d", response.StatusCode)
    	}
    
    	return nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jan 26 20:34:28 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  9. pkg/proxy/healthcheck/proxier_health.go

    	if !healthy {
    		metrics.ProxyHealthzTotal.WithLabelValues("503").Inc()
    		resp.WriteHeader(http.StatusServiceUnavailable)
    	} else {
    		metrics.ProxyHealthzTotal.WithLabelValues("200").Inc()
    		resp.WriteHeader(http.StatusOK)
    		// In older releases, the returned "lastUpdated" time indicated the last
    		// time the proxier sync loop ran, even if nothing had changed. To
    		// preserve compatibility, we use the same semantics: the returned
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 16 10:41:18 UTC 2023
    - 8K bytes
    - Viewed (0)
  10. internal/config/identity/openid/jwt.go

    	client := &http.Client{
    		Transport: r.transport,
    	}
    
    	resp, err := client.Get(pCfg.JWKS.URL.String())
    	if err != nil {
    		return err
    	}
    	defer r.closeRespFn(resp.Body)
    	if resp.StatusCode != http.StatusOK {
    		return errors.New(resp.Status)
    	}
    
    	return r.pubKeys.parseAndAdd(resp.Body)
    }
    
    // ErrTokenExpired - error token expired
    var (
    	ErrTokenExpired = errors.New("token expired")
    )
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 30 18:10:41 UTC 2024
    - 8.3K bytes
    - Viewed (0)
Back to top