New Fluxzy v2 just shipped. Electron is out, Tauri is in. gRPC ready, 3x smaller install. Learn more

formUrlEncodedRequestFilter Filter

Select requests sending application/x-www-form-urlencoded bodies, the classic encoding for HTML forms without file uploads.

formUrlEncodedRequestFilter is the narrow counterpart to formRequestFilter. Use it when the multipart variant must be excluded, typically because you only care about classic key value form submissions.

When to use this filter

Use formUrlEncodedRequestFilter when you want to act only on urlencoded form posts, the encoding produced by HTML forms that do not include file fields. The filter matches by inspecting the Content-Type request header for application/x-www-form-urlencoded.

Typical situations:

  • Adding a tracing header to legacy form posts that are not yet migrated to JSON APIs.
  • Mocking the response of an urlencoded login or sign up endpoint during frontend development.
  • Stripping a CSRF cookie on test traffic without affecting JSON or multipart requests.

The filter fires on the requestHeaderReceivedFromClient scope. If you also need to cover multipart uploads, use the broader formRequestFilter. If you want any request with a body, use hasRequestBodyFilter.

Real world examples

Mock the response of a legacy login form

Return a deterministic redirect when an urlencoded login is posted so the frontend can be exercised without a working auth backend.

rules:
- filter:
    typeKind: FilterCollection
    operation: and
    children:
    - typeKind: PathFilter
      pattern: /login
      operation: Exact
    - typeKind: FormUrlEncodedRequestFilter
  actions:
  - typeKind: MockedResponseAction
    response:
      statusCode: 302
      headers:
      - name: Location
        value: /dashboard

Tag legacy form posts for migration tracking

Tag every urlencoded form post so you can audit which endpoints still rely on the legacy encoding and need migration to JSON.

rules:
- filter:
    typeKind: FormUrlEncodedRequestFilter
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: legacy-form-post

Strip a tracking header on urlencoded posts

Remove a vendor specific tracking header from urlencoded form submissions in a privacy focused testing session.

rules:
- filter:
    typeKind: FormUrlEncodedRequestFilter
  actions:
  - typeKind: DeleteRequestHeaderAction
    headerName: X-Vendor-Track

Reference

formUrlEncodedRequestFilter

Description

Select request sending 'application/x-www-form-urlencoded' body. Filtering is made by inspecting value of Content-Type header

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client

YAML configuration name

formUrlEncodedRequestFilter

Settings

This filter has no specific characteristic

The following table describes the customizable properties available for this filter:

Property Type Description DefaultValue
inverted boolean Negate the filter result false

Example of usage

The following examples apply a comment to the filtered exchange

Select exchanges having request header dnt: 1.

rules:
- filter:
    typeKind: RequestHeaderFilter
    headerName: dnt
    pattern: 1
    operation: Exact
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

Select exchanges issued by Chrome 112 by checking User-Agent.

rules:
- filter:
    typeKind: RequestHeaderFilter
    headerName: User-Agent
    pattern: 'Chrome/112 '
    operation: Contains
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

.NET reference

View definition of FormUrlEncodedRequestFilter for .NET integration.

See also

This filter has no related filter

Frequently asked questions

Does this filter cover multipart uploads?

No. multipart/form-data is excluded by design. Use formRequestFilter to cover both encodings, or pair this filter with a separate multipart rule.

How is the match performed?

Fluxzy inspects the Content-Type request header. The body itself is not parsed, so a header that lies about the encoding will be trusted.

Will it match requests with a charset parameter?

Yes. The filter accounts for the standard parameter forms such as application/x-www-form-urlencoded; charset=UTF-8.

Can I combine it with a method filter?

Yes. Wrap it in a filterCollection with a postFilter or putFilter when the method must also be constrained.

Is the filter case sensitive?

No. MIME type comparisons are case insensitive per RFC, so Application/X-WWW-Form-Urlencoded matches just as well.

Learn more about Fluxzy rules