// SetParam adds the keys and values as query parameters to the requests.
SetParam adds the keys and values as query parameters to the requests.
// SetParam adds the keys and values as query parameters to the requests .
func (r *Req) SetParam(params map[string]interface{}) *Req {
	var counter = 1
	var prefix = "?"
	var result []string
	for k, v := range params {
		if counter > 1 {
			prefix = "&"
		}
		query := fmt.Sprintf("%s%s=%v", prefix, k, v)
		query = strings.Replace(query, " ", "+", -1)
		result = append(result, query)
		counter++
	}
	queryString := strings.Join(result, "")
	r.address = r.address + queryString
	return r
}
func ( r * Req ) SetParam ( params map [ string ] interface { } ) * Req { var counter = 1 var prefix = " " var result [ ] string for k , v := range params { if counter > 1 { prefix = " " } query := fmt . Sprintf ( " " , prefix , k , v ) query = strings . Replace ( query , " " , " " , - 1 ) result = append ( result , query ) counter ++ } queryString := strings . Join ( result , " " ) r . address = r . address + queryString return r }
SetParam adds the keys and values as query parameters to the requests.
SetParam adds the keys and values as query parameters to the requests .
// TODO support structs // * turn structs into maps using reflect package // * and pass them to this method.