package http

import "github.com/redhatinsights/yggdrasil/internal/http"

Index

Types

type Client

type Client struct {
	http.Client

	// Retries is the number of times the client will attempt to resend failed
	// HTTP requests before giving up.
	Retries int
	// contains filtered or unexported fields
}

Client is a specialized HTTP client, configured with mutual TLS certificate authentication.

func NewHTTPClient

func NewHTTPClient(config *tls.Config, ua string) *Client

NewHTTPClient creates a client with the given TLS configuration and user-agent string.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(url string) (*http.Response, error)

func (*Client) Post

func (c *Client) Post(url string, headers map[string]string, body []byte) (*http.Response, error)

Source Files

client.go

Version
v0.4.5 (latest)
Published
Feb 3, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
3 weeks ago

Tools for package owners.