func post()

in common/http_client/post.go [29:48]


func post(url string, header http.Header, timeoutMs uint64, params map[string]string) (response *http.Response, err error) {
	client := http.Client{}
	client.Timeout = time.Millisecond * time.Duration(timeoutMs)

	//body := GetUrlFormedMap(params)
	body, _ := json.Marshal(params)
	request, errNew := http.NewRequest(http.MethodPost, url, strings.NewReader(string(body)))
	if errNew != nil {
		err = errNew
		return
	}
	request.Header = header
	resp, errDo := client.Do(request)
	if errDo != nil {
		err = errDo
	} else {
		response = resp
	}
	return
}