MCPcopy Create free account
hub / github.com/bytebase/bytebase / NewHTTPClient

Function NewHTTPClient

action/bitbucket/bitbucket.go:145–158  ·  view source on GitHub ↗

NewHTTPClient returns the Bitbucket HTTP client. Bitbucket Pipelines reaches the public API through its localhost proxy.

(apiURL string)

Source from the content-addressed store, hash-verified

143// NewHTTPClient returns the Bitbucket HTTP client. Bitbucket Pipelines reaches
144// the public API through its localhost proxy.
145func NewHTTPClient(apiURL string) *http.Client {
146 if apiURL != APIBaseURL {
147 return http.DefaultClient
148 }
149 proxyURL, err := url.Parse(pipelinesProxyURL)
150 if err != nil {
151 return http.DefaultClient
152 }
153 return &http.Client{
154 Transport: &http.Transport{
155 Proxy: http.ProxyURL(proxyURL),
156 },
157 }
158}
159
160func sendPutRequest(client *http.Client, method, url, data string) error {
161 req, err := http.NewRequest(method, url, bytes.NewBufferString(data))

Callers 3

getBitbucketVCSUserFunction · 0.92
CreateBitbucketReportFunction · 0.85

Calls

no outgoing calls