<commit_before>package restclient

import (
	"net/url"
	"reflect"
	"strconv"
	"strings"

	"github.com/golang/glog"
)

type tagOptions string

// encodeForm encodes the request body to url.Values.Encode()
func (r *Request) encodeForm() ([]byte, error) {
	var out []byte
	if glog.V(3) {
		glog.Infoln("Encoding bodyObject (", r.RequestBody, ") to url.Values form")
	}

	v, err := structToVals(r.RequestBody)
	if err != nil {
		glog.Errorln("Failed to convert struct to url.Values:", err.Error())
		return out, err
	}

	// Convert the Request struct to an url.Values map
	// Encode url.Values to urlencoded format
	out = []byte(v.Encode())
	return out, nil<commit_msg>fixed the form error response<commit_after>package restclient

import (
	"net/url"
	"reflect"
	"strconv"
	"strings"

	"github.com/golang/glog"
)

type tagOptions string

// encodeForm encodes the request body to url.Values.Encode()
func (r *Request) encodeForm() ([]byte, error) {
	var out []byte
	if glog.V(3) {
		glog.Infof("Encoding bodyObject (%+v) to url.Values form\n", r.RequestBody)
	}

	v, err := structToVals(r.RequestBody)
	if err != nil {
		glog.Errorln("Failed to convert struct to url.Values:", err.Error())
		return out, err
	}

	// Convert the Request struct to an url.Values map
	// Encode url.Values to urlencoded format
	out = []byte(v.Encode())
	return out, nil
{'fraction_non_alphanumeric': 0.13818722139673106, 'fraction_numerical': 0.0014858841010401188, 'mean_word_length': 3.970479704797048, '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': '7157478', 'n_tokens_mistral': 489, 'n_tokens_neox': 470, 'n_words': 142}