Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 114 for body (0.22 sec)

  1. cmd/admin-handlers-site-replication.go

    	if err := parseJSONBody(ctx, r.Body, &sites, cred.SecretKey); err != nil {
    		writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
    		return
    	}
    
    	opts := getSRAddOptions(r)
    	status, err := globalSiteReplicationSys.AddPeerClusters(ctx, sites, opts)
    	if err != nil {
    		adminLogIf(ctx, err)
    		writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
    		return
    	}
    
    	body, err := json.Marshal(status)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 15 09:40:39 GMT 2024
    - 19.4K bytes
    - Viewed (0)
  2. cmd/http-tracer.go

    		// Setup a http request response recorder - this is needed for
    		// http stats requests and audit if enabled.
    		respRecorder := xhttp.NewResponseRecorder(w)
    
    		// Setup a http request body recorder
    		reqRecorder := &xhttp.RequestRecorder{Reader: r.Body}
    		r.Body = reqRecorder
    
    		// Create tracing data structure and associate it to the request context
    		tc := mcontext.TraceCtxt{
    			AmzReqID:         w.Header().Get(xhttp.AmzRequestID),
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 5.9K bytes
    - Viewed (0)
  3. cmd/handler-utils_test.go

    	// Corrupted XML
    	malformedReq := &http.Request{
    		Body:          io.NopCloser(bytes.NewReader([]byte("<>"))),
    		ContentLength: int64(len("<>")),
    	}
    
    	// Not an XML
    	badRequest := &http.Request{
    		Body:          io.NopCloser(bytes.NewReader([]byte("garbage"))),
    		ContentLength: int64(len("garbage")),
    	}
    
    	// generates the input request with XML bucket configuration set to the request body.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  4. internal/event/target/elasticsearch.go

    	res, err := c.Indices.ResolveIndex([]string{args.Index})
    	if err != nil {
    		return err
    	}
    	defer res.Body.Close()
    
    	var v map[string]interface{}
    	found := false
    	if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
    		return fmt.Errorf("Error parsing response body: %v", err)
    	}
    
    	indices, ok := v["indices"].([]interface{})
    	if ok {
    		for _, index := range indices {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 15K bytes
    - Viewed (0)
  5. istioctl/pkg/util/handlers/handlers_test.go

    			case p == "/namespaces/istio-system/deployments/foo" && m == "GET":
    				body := cmdtesting.ObjBody(codec, attachDeploy("istio-system"))
    				return &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: body}, nil
    			case p == "/namespaces/test/deployments/foo" && m == "GET":
    				body := cmdtesting.ObjBody(codec, attachDeploy("test"))
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jun 09 18:17:49 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  6. cmd/batch-handlers.go

    	}
    	req.Header.Set("Content-Type", "application/json")
    
    	clnt := http.Client{Transport: getRemoteInstanceTransport()}
    	resp, err := clnt.Do(req)
    	if err != nil {
    		return err
    	}
    
    	xhttp.DrainBody(resp.Body)
    	if resp.StatusCode != http.StatusOK {
    		return errors.New(resp.Status)
    	}
    
    	return nil
    }
    
    // Notify notifies notification endpoint if configured regarding job failure or success.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 08 14:11:38 GMT 2024
    - 55.2K bytes
    - Viewed (0)
  7. internal/config/cache/cache.go

    	}
    
    	resp, err := c.clnt.Do(req)
    	if err != nil {
    		return nil, err
    	}
    	defer xhttp.DrainBody(resp.Body)
    
    	switch resp.StatusCode {
    	case http.StatusNotFound:
    		return nil, ErrKeyMissing
    	case http.StatusOK:
    		co := &ObjectInfo{}
    		return co, co.DecodeMsg(msgp.NewReader(resp.Body))
    	default:
    		return nil, ErrInvalidArgument
    	}
    }
    
    // Set sets the cache object info
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  8. internal/http/close.go

    )
    
    // DrainBody close non nil response with any response Body.
    // convenient wrapper to drain any remaining data on response body.
    //
    // Subsequently this allows golang http RoundTripper
    // to reuse the same connection for future requests.
    func DrainBody(respBody io.ReadCloser) {
    	// Callers should close resp.Body when done reading from it.
    	// If resp.Body is not closed, the Client's underlying RoundTripper
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  9. cmd/object-handlers_test.go

    			t.Fatalf("Case %d: Expected the response status to be `%d`, but instead found `%d`", i+1, testCase.expectedRespStatus, rec.Code)
    		}
    		// read the response body.
    		actualContent, err := io.ReadAll(rec.Body)
    		if err != nil {
    			t.Fatalf("Test %d: %s: Failed reading response body: <ERROR> %v", i+1, instanceType, err)
    		}
    
    		if rec.Code == http.StatusOK || rec.Code == http.StatusPartialContent {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 160K bytes
    - Viewed (0)
  10. src/cmd/cgo/ast.go

    		f.walk(n.Body, ctxSwitch, visit)
    	case *ast.TypeSwitchStmt:
    		f.walk(n.Init, ctxStmt, visit)
    		f.walk(n.Assign, ctxStmt, visit)
    		f.walk(n.Body, ctxTypeSwitch, visit)
    	case *ast.CommClause:
    		f.walk(n.Comm, ctxStmt, visit)
    		f.walk(n.Body, ctxStmt, visit)
    	case *ast.SelectStmt:
    		f.walk(n.Body, ctxStmt, visit)
    	case *ast.ForStmt:
    		f.walk(n.Init, ctxStmt, visit)
    		f.walk(&n.Cond, ctxExpr, visit)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jun 07 16:54:27 GMT 2023
    - 14.3K bytes
    - Viewed (0)
Back to top