func (c *Client) Put(ctx context.Context, path string, body io.Reader) (*http.Response, error) {
	req, err := c.newRequest(ctx, "PUT", path, body)
	if err != nil {
		return nil, err
	}
	return c.http.Do(req)
}
Put Perform a PUT Request to Kibana
package kibana
import (
	"context"
	"crypto/tls"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"strings"
	"time"
	"github.com/Masterminds/semver/v3"
	"github.com/sherifabdlnaby/rubban/config"
	"github.com/sherifabdlnaby/rubban/log"
	"github.com/sherifabdlnaby/rubban/version"
)
type Client struct {
	baseURL  *url.URL
	username string
	password string
	http     *http.Client
	logger   log.Logger
}
func NewKibanaClient(config config.Kibana, logger log.Logger) (*Client, error) {
	rawURL := config.Host
	if !strings.HasPrefix(rawURL, "http://") && !strings.HasPrefix(rawURL, "https://") {
		rawURL = "http://" + rawURL
	}
	baseURL, err := url.Parse(rawURL)
	if err != nil {
		return nil, err
	}
	return &Client{
		baseURL:  baseURL,
		username: config.User,
		password: config.Password,
		http: &http.Client{
			Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
			Timeout:   10 * time.Second,
		},
		logger: logger,
	}, nil
}
func (c *Client) getURLFromPath(path string) string {
	return c.baseURL.String() + path
}
func (c *Client) newRequest(ctx context.Context, method string, path string, body io.Reader) (*http.Request, error) {
	req, err := http.NewRequestWithContext(ctx, method, c.getURLFromPath(path), body)
	if err != nil {
		return nil, err
	}
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("kbn-xsrf", "true")
	req.Header.Set("User-Agent", "Rubban/"+version.Version)
	req.SetBasicAuth(c.username, c.password)
	return req, nil
}
func (c *Client) Get(ctx context.Context, path string, body io.Reader) (*http.Response, error) {
	req, err := c.newRequest(ctx, "GET", path, body)
	if err != nil {
		return nil, err
	}
	return c.http.Do(req)
}
func (c *Client) Post(ctx context.Context, path string, body io.Reader) (*http.Response, error) {
	req, err := c.newRequest(ctx, "POST", path, body)
	if err != nil {
		return nil, err
	}
	return c.http.Do(req)
}