New Transparent capture is in preview. Record every app's traffic with no proxy configuration, on Windows, macOS and Linux. Learn more

putFilter Filter

Select exchanges whose request method is PUT, a common signal for upsert and resource replacement operations in REST APIs.

putFilter is a concise way to express a method scoped rule for resource replacement traffic. Pair it with a host or path filter inside a filterCollection to keep the rule precise, and combine it with mock or reject actions to shape what the client sees during testing.

When to use this filter

Use putFilter when you want a rule that targets only HTTP PUT exchanges. PUT is typically used for full resource replacement, idempotent upserts, and certain object storage uploads, so a method scoped rule is often the cleanest way to focus on that traffic.

Typical situations:

  • Auditing every PUT against a REST API to detect unexpected resource replacements.
  • Tagging file uploads to S3 compatible buckets that rely on PUT object semantics.
  • Mocking PUT responses for an API still in development while letting GET continue to pass through.

The filter evaluates on the requestHeaderReceivedFromClient scope. Combine it with hostFilter, pathFilter or a filterCollection to scope it to a specific API surface.

Real world examples

Tag every PUT against a REST API

Apply a tag to all PUT requests on a specific host so you can audit upsert traffic without touching reads or deletes.

rules:
- filter:
    typeKind: FilterCollection
    children:
    - typeKind: PutFilter
    - typeKind: HostFilter
      pattern: api.example.com
    operation: And
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: rest-upsert

Reject PUT during a read only maintenance window

Block any PUT against the API to enforce a read only mode while the database is being migrated.

rules:
- filter:
    typeKind: PutFilter
  actions:
  - typeKind: RejectWithStatusCodeAction
    statusCode: 503

Mock PUT responses for a new endpoint

Return a canned 200 for every PUT while the backend is still being implemented, so the client can be tested end to end.

rules:
- filter:
    typeKind: PutFilter
  actions:
  - typeKind: MockedResponseAction
    response:
      statusCode: 200
      body:
        type: fromString
        text: '{"status":"accepted"}'
        contentType: application/json

Reference

putFilter

Description

Select exchanges according to request 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

putFilter

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 according to request method.

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

.NET reference

View definition of PutFilter for .NET integration.

See also

The following filters are related to this filter:

Frequently asked questions

How is putFilter different from methodFilter?

putFilter is a shortcut that always matches PUT. methodFilter accepts any value, so use putFilter when you want a concise rule and methodFilter when you need to parameterize the method or match several methods at once.

Does it match WebDAV PUT or only REST PUT?

It matches any request whose HTTP method is PUT, regardless of the protocol on top. WebDAV and S3 style uploads are matched too.

Can I invert the filter to select everything except PUT?

Yes, set inverted: true. The rule then fires for every exchange whose method is not PUT.

When does the filter fire in the pipeline?

It evaluates on the requestHeaderReceivedFromClient scope, as soon as the request line is parsed. This is the earliest opportunity to act on a method scoped rule.

Learn more about Fluxzy rules