func ParseEncodeRequest(values url.Values) (encoder qrcode.QREncoder, err error) {
	encoder.Content = values.Get(contentField)
	if len(encoder.Content) == 0 {
		err = errors.New("content is empty")
		return
	}
	if len(encoder.Content) > 2048 {
		err = errors.New("content should be no more than 2KB")
		return
	}
	size, badNum := strconv.ParseInt(values.Get(sizeField), 10, 64)
	if badNum != nil || size <= 0 || size > int64(C.MaxEncodeWidth) {
		encoder.Size = C.DefaultEncodeWidth
	} else {
		encoder.Size = int(size)
	}
	encoder.Type = values.Get(typeField)
	return
}
ParseEncodeRequest convert encoding request to struct
package main
import (
	"errors"
	"net/url"
	"strconv"
	"github.com/nanmu42/qrcode-api"
)
const (
	contentField = "content"
	typeField    = "type"
	sizeField    = "size"
)