probelabs/goreplay · error

Expected `Key=Value`

Error message

Expected `Key=Value`

What it means

Flag-value validation error raised by HTTPParams.Set (used by --http-set-param) when the argument cannot be split into exactly two '='-separated parts, so no query-parameter name/value pair can be appended.

Source

Thrown at http_modifier_settings.go:172

// Handling of --http-set-param option
type httpParam struct {
	Name  []byte
	Value []byte
}

// HTTPParams filters for --http-set-param
type HTTPParams []httpParam

func (h *HTTPParams) String() string {
	return fmt.Sprint(*h)
}

// Set method to implement flags.Value
func (h *HTTPParams) Set(value string) error {
	v := strings.SplitN(value, "=", 2)
	if len(v) != 2 {
		return errors.New("Expected `Key=Value`")
	}

	param := httpParam{
		[]byte(strings.TrimSpace(v[0])),
		[]byte(strings.TrimSpace(v[1])),
	}

	*h = append(*h, param)
	return nil
}

//
// Handling of --http-allow-method option
//

// HTTPMethods holds values for method allowed
type HTTPMethods [][]byte

View on GitHub (pinned to 251e45abd2)

Solutions

  1. Use 'Key=Value' form, e.g. --http-set-param 'api_token=abc123'
  2. Note the delimiter is '=', not ':' unlike header flags
  3. Escape or quote the argument so '=' is preserved by the shell
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at http_modifier_settings.go:172 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of probelabs/goreplay@251e45abd2 (2026-09-02). Data as JSON: /api/errors/3fff392921b9e956. Report an issue: GitHub.