func emptyQueryValues(values url.Values) bool {
	for _, val := range values {
		if len(val) > 1 {
			return false
		}
	}
	return true
}
If the values are empty in the map, then don't encode anythin
This keeps the compatibility with the python implementation
package http
import (
	"bytes"
	"errors"
	"fmt"
	"net/http"
	"net/url"
	"github.com/fzipi/go-ftw/utils"
	"github.com/rs/zerolog/log"
)
type Destination struct {
	DestAddr string `default:"localhost"`
	Port     int    `default:"80"`
	Protocol string `default:"http"`
}
type RequestLine struct {
	Method  string `default:"GET"`
	Version string `default:"HTTP/1.1"`
	URI     string `default:"/"`
}
func (rl RequestLine) ToString() string {
	return fmt.Sprintf("%s %s %s\r\n", rl.Method, rl.URI, rl.Version)
}
type Request struct {
	requestLine         *RequestLine
	headers             Header
	cookies             http.CookieJar
	data                []byte
	raw                 []byte
	autoCompleteHeaders bool
}
func NewRequest(reqLine *RequestLine, h Header, data []byte, b bool) *Request {
	r := &Request{
		requestLine:         reqLine,
		headers:             h.Clone(),
		cookies:             nil,
		data:                data,
		raw:                 nil,
		autoCompleteHeaders: b,
	}
	return r
}
func NewRawRequest(raw []byte, b bool) *Request {
	r := &Request{
		raw:                 raw,
		autoCompleteHeaders: b,
	}
	return r
}
func (r *Request) SetAutoCompleteHeaders(value bool) {
	r.autoCompleteHeaders = value
}
func (r Request) WithAutoCompleteHeaders() bool {
	return r.autoCompleteHeaders
}
func (r *Request) SetData(data []byte) error {
	if utils.IsNotEmpty(r.raw) {
		return errors.New("ftw/http: raw field is already present in this request")
	}
	r.data = data
	return nil
}
func (r *Request) SetRawData(raw []byte) error {
	if utils.IsNotEmpty(r.data) {
		return errors.New("ftw/http: data field is already present in this request")
	}
	r.raw = raw
	return nil
}
func (r Request) Data() []byte {
	return r.data
}
func (r Request) RawData() []byte {
	return r.raw
}
func (r Request) Headers() Header {
	if r.headers == nil {
		return nil
	}
	return r.headers
}
func (r *Request) SetHeaders(h Header) {
	r.headers = h
}
func (r *Request) AddHeader(name string, value string) {
	r.headers.Add(name, value)
}
func (r *Request) AddStandardHeaders(size int) {
	r.headers.AddStandard(size)
}
func (c *Connection) Request(request *Request) error {
	data, err := buildRequest(request)
	if err != nil {
		log.Fatal().Msgf("ftw/http: fatal error building request: %s", err.Error())
	}
	log.Debug().Msgf("ftw/http: sending data:\n%s\n", data)
	_, err = c.send(data)
	if err != nil {
		log.Error().Msgf("ftw/http: error writing data: %s", err.Error())
	}
	return err
}
func (r Request) isRaw() bool {
	return utils.IsNotEmpty(r.raw)
}
func buildRequest(r *Request) ([]byte, error) {
	var err error
	var b bytes.Buffer
	if !r.isRaw() {
		_, err = fmt.Fprintf(&b, "%s", r.requestLine.ToString())
		if err != nil {
			return nil, err
		}
		log.Trace().Msgf("ftw/http: this is data: %q, of len %d", r.data, len(r.data))
		if utils.IsNotEmpty(r.data) && r.WithAutoCompleteHeaders() {
			r.AddHeader("Content-Type", "application/x-www-form-urlencoded")
			err := r.SetData(encodeDataParameters(r.headers, r.data))
			if err != nil {
				log.Info().Msgf("ftw/http: cannot set data to: %q", r.data)
			}
		}
		if r.WithAutoCompleteHeaders() {
			log.Trace().Msgf("ftw/http: adding standard headers")
			r.AddStandardHeaders(len(r.data))
		}
		err = r.Headers().WriteBytes(&b)
		if err != nil {
			log.Debug().Msgf("ftw/http: error writing to buffer: %s", err.Error())
			return nil, err
		}
		_, err = fmt.Fprintf(&b, "\r\n")
		if utils.IsNotEmpty(r.data) {
			_, err = fmt.Fprintf(&b, "%s", r.data)
		}
	} else {
		dumpRawData(&b, r.raw)
	}
	return b.Bytes(), err
}