func NewHTTPProviderFromConfig(other map[string]interface{}) (IntProvider, error) {
	cc := struct {
		URI, Method string
		Headers     map[string]string
		Body        string
		Jq          string
		Scale       float64
		Insecure    bool
		Auth        Auth
		Timeout     time.Duration
	}{
		Headers: make(map[string]string),
		Timeout: request.Timeout,
	}

	if err := util.DecodeOther(other, &cc); err != nil {
		return nil, err
	}

	log := util.NewLogger("http")

	// handle basic auth
	if cc.Auth.Type != "" {
		if err := AuthHeaders(log, cc.Auth, cc.Headers); err != nil {
			return nil, fmt.Errorf("http auth: %w", err)
		}
	}

	http, err := NewHTTP(log,
		cc.Method,
		cc.URI,
		cc.Headers,
		cc.Body,
		cc.Insecure,
		cc.Jq,
		cc.Scale,
	)
	if err != nil {
		return nil, err
	}

	if err == nil {
		http.Client.Timeout = cc.Timeout
	}

	return http, err
}
// NewHTTPProviderFromConfig creates a HTTP provider
NewHTTPProviderFromConfig creates a HTTP provider
// NewHTTPProviderFromConfig creates a HTTP provider
func NewHTTPProviderFromConfig(other map[string]interface{}) (IntProvider, error) {
	cc := struct {
		URI, Method string
		Headers     map[string]string
		Body        string
		Jq          string
		Scale       float64
		Insecure    bool
		Auth        Auth
		Timeout     time.Duration
	}{
		Headers: make(map[string]string),
		Timeout: request.Timeout,
	}
	if err := util.DecodeOther(other, &cc); err != nil {
		return nil, err
	}
	log := util.NewLogger("http")
	if cc.Auth.Type != "" {
		if err := AuthHeaders(log, cc.Auth, cc.Headers); err != nil {
			return nil, fmt.Errorf("http auth: %w", err)
		}
	}
	http, err := NewHTTP(log,
		cc.Method,
		cc.URI,
		cc.Headers,
		cc.Body,
		cc.Insecure,
		cc.Jq,
		cc.Scale,
	)
	if err != nil {
		return nil, err
	}
	if err == nil {
		http.Client.Timeout = cc.Timeout
	}
	return http, err
}
func NewHTTPProviderFromConfig ( other map [ string ] interface { } ) ( IntProvider , error ) { cc := struct { URI , Method string Headers map [ string ] string Body string Jq string Scale float64 Insecure bool Auth Auth Timeout time . Duration } { Headers : make ( map [ string ] string ) , Timeout : request . Timeout , } if err := util . DecodeOther ( other , & cc ) ; err != nil { return nil , err } log := util . NewLogger ( " " ) if cc . Auth . Type != " " { if err := AuthHeaders ( log , cc . Auth , cc . Headers ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } } http , err := NewHTTP ( log , cc . Method , cc . URI , cc . Headers , cc . Body , cc . Insecure , cc . Jq , cc . Scale , ) if err != nil { return nil , err } if err == nil { http . Client . Timeout = cc . Timeout } return http , err }
NewHTTPProviderFromConfig creates a HTTP provider
NewHTTPProviderFromConfig creates a HTTP provider
// handle basic auth