<commit_before>package bamboocli

import (
	"net/http"

	log "github.com/Sirupsen/logrus"
)

type HTTPClient struct {
}

func (client HTTPClient) httpclient(cred credentials, method string) {
	log.Debug("httpclient function")
	if cred.token == "" {
		cred.token = getAuthToken(cred)
	}
	client := &http.Client{}
	req, _ := http.NewRequest(method, cred.baseurl+cred.apiuri, nil)
	tokencookie := &http.Cookie{Name: "atl.xsrf.token", Value: cred.token, HttpOnly: false}
	req.AddCookie(tokencookie)
	resp, err := client.Do(req)
}<commit_msg>Adding httpclient to handle all calls<commit_after>package bamboocli

import (
	"net/http"

	log "github.com/Sirupsen/logrus"
)

func httpclient(cred credentials, method string) *http.Response {
	log.Debug("httpclient function")
	if cred.token == "" {
		cred.token = getAuthToken(cred)
	}
	httpclient := &http.Client{}
	req, _ := http.NewRequest(method, cred.baseurl+cred.apiuri, nil)

	//Adding auth cookie to call bamboo REST API
	tokencookie := &http.Cookie{Name: "atl.xsrf.token", Value: cred.token, HttpOnly: false}
	req.AddCookie(tokencookie)
	resp, err := httpclient.Do(req)
	if err != nil {
		log.Error("Error calling url:", cred.baseurl+cred.apiuri)
	}
	log.Debug(resp)
	return resp
}
{'fraction_non_alphanumeric': 0.14390243902439023, 'fraction_numerical': 0.0, 'mean_word_length': 4.889952153110048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3163413', 'n_tokens_mistral': 450, 'n_tokens_neox': 436, 'n_words': 97}