github.com/wikibal01/hashicorp-terraform@v0.11.12-beta1/httpclient/client.go (about)

     1  package httpclient
     2  
     3  import (
     4  	"net/http"
     5  
     6  	cleanhttp "github.com/hashicorp/go-cleanhttp"
     7  )
     8  
     9  // New returns the DefaultPooledClient from the cleanhttp
    10  // package that will also send a Terraform User-Agent string.
    11  func New() *http.Client {
    12  	cli := cleanhttp.DefaultPooledClient()
    13  	cli.Transport = &userAgentRoundTripper{
    14  		userAgent: UserAgentString(),
    15  		inner:     cli.Transport,
    16  	}
    17  	return cli
    18  }