Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for NewRequest (0.15 sec)

  1. internal/config/identity/openid/provider/keycloak.go

    	values := url.Values{}
    	values.Set("client_id", clientID)
    	values.Set("client_secret", clientSecret)
    	values.Set("grant_type", "client_credentials")
    
    	req, err := http.NewRequest(http.MethodPost, k.oeConfig.TokenEndpoint, strings.NewReader(values.Encode()))
    	if err != nil {
    		return err
    	}
    	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
    
    	resp, err := k.client.Do(req)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 29 01:27:09 GMT 2022
    - 4.6K bytes
    - Viewed (0)
  2. cmd/signature-v2_test.go

    		query := url.Values{}
    		for key, value := range testCase.queryParams {
    			query.Set(key, value)
    		}
    		// Create a request to use.
    		req, err := http.NewRequest(http.MethodGet, "http://host/a/b?"+query.Encode(), nil)
    		if err != nil {
    			t.Errorf("(%d) failed to create http.Request, got %v", i, err)
    		}
    		if testCase.expected != ErrNone {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Oct 14 10:08:40 GMT 2022
    - 8K bytes
    - Viewed (0)
  3. cmd/update.go

    	}
    	uaAppend(")", "")
    
    	return strings.Join(userAgentParts, "")
    }
    
    func downloadReleaseURL(u *url.URL, timeout time.Duration, mode string) (content string, err error) {
    	req, err := http.NewRequest(http.MethodGet, u.String(), nil)
    	if err != nil {
    		return content, AdminError{
    			Code:       AdminUpdateUnexpectedFailure,
    			Message:    err.Error(),
    			StatusCode: http.StatusInternalServerError,
    		}
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  4. internal/config/subnet/subnet.go

    	part, e := writer.CreateFormFile("file", filename)
    	if e != nil {
    		return "", e
    	}
    
    	if _, e = part.Write(payload); e != nil {
    		return "", e
    	}
    	writer.Close()
    
    	r, e := http.NewRequest(http.MethodPost, reqURL, &body)
    	if e != nil {
    		return "", e
    	}
    	r.Header.Add("Content-Type", writer.FormDataContentType())
    
    	return c.submitPost(r)
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Feb 27 16:35:36 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  5. internal/config/identity/openid/jwt.go

    }
    
    func parseDiscoveryDoc(u *xnet.URL, transport http.RoundTripper, closeRespFn func(io.ReadCloser)) (DiscoveryDoc, error) {
    	d := DiscoveryDoc{}
    	req, err := http.NewRequest(http.MethodGet, u.String(), nil)
    	if err != nil {
    		return d, err
    	}
    	clnt := http.Client{
    		Transport: transport,
    	}
    	resp, err := clnt.Do(req)
    	if err != nil {
    		return d, err
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Nov 16 04:42:31 GMT 2023
    - 8.3K bytes
    - Viewed (5)
  6. internal/event/target/webhook.go

    	data, err := json.Marshal(event.Log{EventName: eventData.EventName, Key: key, Records: []event.Event{eventData}})
    	if err != nil {
    		return err
    	}
    
    	req, err := http.NewRequest(http.MethodPost, target.args.Endpoint.String(), bytes.NewReader(data))
    	if err != nil {
    		return err
    	}
    
    	// Verify if the authToken already contains
    	// <Key> <Token> like format, if this is
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Nov 20 22:40:07 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  7. cmd/signature-v4-utils_test.go

    	}
    
    	for i, testCase := range testCases {
    		// creating an input HTTP request.
    		// Only the headers are relevant for this particular test.
    		inputReq, err := http.NewRequest(http.MethodGet, "http://example.com", nil)
    		if err != nil {
    			t.Fatalf("Error initializing input HTTP request: %v", err)
    		}
    		if testCase.inputQueryKey != "" {
    			q := inputReq.URL.Query()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 05 21:26:41 GMT 2024
    - 14.3K bytes
    - Viewed (0)
  8. internal/rest/client.go

    func removeEmptyPort(host string) string {
    	if hasPort(host) {
    		return strings.TrimSuffix(host, ":")
    	}
    	return host
    }
    
    // Copied from http.NewRequest but implemented to ensure we reuse `url.URL` instance.
    func (c *Client) newRequest(ctx context.Context, u url.URL, body io.Reader) (*http.Request, error) {
    	rc, ok := body.(io.ReadCloser)
    	if !ok && body != nil {
    		rc = io.NopCloser(body)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  9. internal/grid/handlers.go

    func (h *SingleHandler[Req, Resp]) NewResponse() Resp {
    	return h.newResp()
    }
    
    // NewRequest creates a new request.
    // Handlers can use this to create a reusable request.
    // The request may be reused, so caller should clear any fields.
    func (h *SingleHandler[Req, Resp]) NewRequest() Req {
    	return h.newReq()
    }
    
    // Register a handler for a Req -> Resp roundtrip.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 27.1K bytes
    - Viewed (0)
  10. internal/config/policy/opa/config.go

    	Transport   http.RoundTripper     `json:"-"`
    	CloseRespFn func(r io.ReadCloser) `json:"-"`
    }
    
    // Validate - validate opa configuration params.
    func (a *Args) Validate() error {
    	req, err := http.NewRequest(http.MethodPost, a.URL.String(), bytes.NewReader([]byte("")))
    	if err != nil {
    		return err
    	}
    
    	req.Header.Set("Content-Type", "application/json")
    	if a.AuthToken != "" {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Sep 14 21:50:16 GMT 2023
    - 5.2K bytes
    - Viewed (1)
Back to top