// Retrieve a POST request field as a string.
// Returns `MissingFieldError` if requested field is missing.
1909
func GetStringField(r *http.Request, fieldName string) (string, error) {
	if _, ok := r.Form[fieldName]; !ok {
		return "", MissingFieldError{fieldName}
	}
	return r.FormValue(fieldName), nil
}
1167240
func (s String) Get() (string, error) {
	if !s.Present() {
		var zero string
		return zero, errors.New("value not present")
	}
	return *s.value, nil
}
71904
func PostForm(url string, data url.Values) (resp *http.Response, err error) {
	c := New()
	return c.PostForm(url, data)
}
653164
func (v Value) GetString() (string, error) {
	var err error

	if v.t != reflect.String {
		err = fmt.Errorf("not a string Value")
	}

	return v.s, err
}
460308
func GetDurationField(r *http.Request, fieldName string) (time.Duration, error) {
	s, err := GetStringField(r, fieldName)
	if err != nil {
		return 0, err
	}
	d, err := time.ParseDuration(s)
	if err != nil || d < 0 {
		return 0, InvalidFormatError{fieldName, s}
	}
	return d, nil
}
433723
func GetField(obj interface{}, name string) (interface{}, error) {
	val := reflect.Indirect(reflect.ValueOf(obj))
	return val.FieldByName(name).Interface(), nil
}
279791
func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) {
	return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
}
436922
func (c *Client) PostForm(url string, data url.Values) (*Response, error) {
	return c.Post(url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
}
956419
func MissingParamError(name string) error {
	msg := fmt.Sprintf("missing required parameter %#v", name)
	return ErrInvalidRequest(msg, "name", name)
}
199593
func GetStringFieldSafe(r *http.Request, fieldName string, allowSet AllowSet) (string, error) {
	if _, ok := r.Form[fieldName]; !ok {
		return "", MissingFieldError{fieldName}
	}

	fieldValue := r.FormValue(fieldName)
	err := allowSet.IsSafe(fieldValue)
	if err != nil {
		return "", UnsafeFieldError{fieldName, err.Error()}
	}

	return fieldValue, nil
}
559179
func GetField(obj interface{}, name string) (interface{}, error) {
	field, err := getInnerField(obj, name)
	if err != nil {
		return nil, err
	}

	return field.Interface(), nil
}
860665
func MustGet(req *http.Request, param string) string {
	if !IsGet(req) {
		panic(InvalidMethodError{})
	}
	v := req.FormValue(param)
	if v == "" {
		panic(MissingParameterError(param))
	}
	return v
}
1270042
func (f *Form) GetField(name string) *Field {
	for _, field := range f.Fields {
		if field.Name == name {
			return field
		}
	}
	return nil
}
987046
func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding {
	for _, binding := range structDescriptor.Fields {
		if binding.Field.Name() == fieldName {
			return binding
		}
	}
	return nil
}
1012724
func GetFields(body []byte) ([]string, error) {
	query, err := pql.ParseString(string(body))
	if err != nil {
		return nil, fmt.Errorf("parsing query: %v", err.Error())
	}

	fields := make([]string, len(query.Calls))

	for i, call := range query.Calls {
		if field, ok := call.Args["field"].(string); ok {
			fields[i] = field
		} else if field, ok := call.Args["_field"].(string); ok {
			fields[i] = field
		} else {
			fields[i] = ""
		}
	}
	return fields, nil
}
1602
func (p *PostService) GetPost(teamName string, postNumber int) (*PostResponse, error) {
	var postRes PostResponse

	postNumberStr := strconv.Itoa(postNumber)

	postURL := PostURL + "/" + teamName + "/posts" + "/" + postNumberStr
	res, err := p.client.get(postURL, url.Values{}, &postRes)
	if err != nil {
		return nil, err
	}

	defer res.Body.Close()

	return &postRes, nil
}
556700
func (d *domainClient) GetRequestPostData(ctx context.Context, args *GetRequestPostDataArgs) (reply *GetRequestPostDataReply, err error) {
	reply = new(GetRequestPostDataReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Network.getRequestPostData", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Network.getRequestPostData", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Network", Op: "GetRequestPostData", Err: err}
	}
	return
}