http/http.go
func Request(entity HttpRequestEntity, method string, body io.Reader) (response *http.Response, err error) {
	transport := NewRoundTripper()
	req, err := http.NewRequest(method, entity.Url, body)
	if err != nil {
		return
	}

	if entity.Authorization == "" {
		req.SetBasicAuth(entity.Username, entity.Password)

	} else {
		req.Header.Add("Authorization", entity.Authorization)
	}

	if entity.ContentType != NO_CONTENT_TYPE {
		req.Header.Add("Content-Type", entity.ContentType)
	}
	return transport.RoundTrip(req)
}
func Request(entity HttpRequestEntity, method string, body io.Reader) (response *http.Response, err error) {
	transport := NewRoundTripper()
	req, err := http.NewRequest(method, entity.Url, body)
	if err != nil {
		return
	}

	if entity.Authorization == "" {
		req.SetBasicAuth(entity.Username, entity.Password)

	} else {
		req.Header.Add("Authorization", entity.Authorization)
	}

	if entity.ContentType != NO_CONTENT_TYPE {
		req.Header.Add("Content-Type", entity.ContentType)
	}
	return transport.RoundTrip(req)
}
func Request ( entity HttpRequestEntity , method string , body io . Reader ) ( response * http . Response , err error ) { transport := NewRoundTripper ( ) req , err := http . NewRequest ( method , entity . Url , body ) if err != nil { return } if entity . Authorization == " " { req . SetBasicAuth ( entity . Username , entity . Password ) } else { req . Header . Add ( " " , entity . Authorization ) } if entity . ContentType != NO_CONTENT_TYPE { req . Header . Add ( " " , entity . ContentType ) } return transport . RoundTrip ( req ) }
//Request -
Request -