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

patchFilter Filter

Select exchanges using the HTTP PATCH method, the canonical verb for partial updates in REST APIs.

patchFilter is the dedicated selector for HTTP PATCH exchanges in a Fluxzy rule. It mirrors the other verb specific filters (getFilter, postFilter, putFilter, deleteFilter) and keeps your YAML readable when you only care about partial updates. Pair it with any action below to act on the write side of a REST API.

When to use this filter

Reach for patchFilter when a rule should only apply to PATCH requests, the canonical verb for partial updates in REST APIs. It is a convenience wrapper around methodFilter with the verb fixed to PATCH, which keeps the YAML compact and readable.

Typical situations:

  • Adding an authorization header to every PATCH call hitting an internal API.
  • Tagging all partial updates so they group together in the capture view.
  • Throttling PATCH requests to reproduce a slow connection during a save operation.

The filter evaluates on the requestHeaderReceivedFromClient scope, so the method is known as soon as the request line is parsed. Combine it with pathFilter or jsonRequestFilter for finer scoping.

Real world examples

Tag every PATCH call for audit

Apply a tag to all PATCH requests so partial updates stand out in the Fluxzy capture view when reviewing API traffic.

rules:
- filter:
    typeKind: PatchFilter
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: patch

Add a bearer token to PATCH calls on the internal API

Attach a bearer token only to PATCH requests heading to the internal API host, leaving GET and other verbs unmodified.

rules:
- filter:
    typeKind: FilterCollection
    children:
    - typeKind: PatchFilter
    - typeKind: HostFilter
      pattern: api.internal.example.com
  actions:
  - typeKind: AddAuthorizationBearerAction
    token: dev-token-123

Throttle PATCH submissions

Slow down every PATCH call to simulate a constrained network during a save operation, useful when validating optimistic UI behavior.

rules:
- filter:
    typeKind: PatchFilter
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 32000

Reference

patchFilter

Description

Select exchanges with PATCH method

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

patchFilter

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 with PATCH method.

rules:
- filter:
    typeKind: PatchFilter
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

.NET reference

View definition of PatchFilter for .NET integration.

See also

The following filters are related to this filter:

Frequently asked questions

How does patchFilter differ from methodFilter?

patchFilter is a convenience wrapper around methodFilter with the verb hardcoded to PATCH. The rule file stays shorter and clearer. Use methodFilter when you need a regex or a custom verb.

Does the filter match case insensitive PATCH variants?

Yes. HTTP methods are normalized before comparison, so patch, Patch and PATCH all match.

Can I invert the filter to exclude PATCH?

Yes. Set inverted: true to select every exchange that is not a PATCH request.

What is the difference with putFilter?

patchFilter matches PATCH (partial update). putFilter matches PUT (full replacement). Both are write verbs in REST APIs but they convey different semantics.

Learn more about Fluxzy rules