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

hasRequestBodyFilter Filter

Match exchanges whose request actually carries a body, so you can scope inspection or rewrites to POSTs, PUTs, and other payload bearing calls.

When debugging APIs, the requests that actually carry data are usually the interesting ones, and the hasRequestBodyFilter is the cleanest way to single them out. It does not assume a method or a content type, just the presence of a payload, which makes it a flexible starting point for body inspection, throttling, or logging workflows.

When to use this filter

Use hasRequestBodyFilter when a rule should only run on requests that actually send a payload. GET and HEAD requests usually have no body, so this filter is the most reliable way to focus on POST, PUT, PATCH, and similar methods without enumerating them by name.

Common uses:

  • Logging or dumping the bodies of API calls without dragging in every static asset fetch.
  • Throttling upload heavy endpoints to reproduce slow client behavior.
  • Pairing with content type filters to act only on JSON or form encoded payloads.

Real world examples

Dump request bodies to a file for inspection

Append every payload bearing request to a file so you can review them offline.

rules:
- filter:
    typeKind: HasRequestBodyFilter
  actions:
  - typeKind: FileAppendAction
    filename: /var/log/fluxzy/request-bodies.log
    text: "{request.url}\n{request.body}\n---\n"

Throttle uploads to a specific host

Simulate a slow uplink for requests that actually carry data, while leaving simple GETs at full speed.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HasRequestBodyFilter
    - typeKind: HostFilter
      pattern: upload.example.com
      operation: Exact
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 16384

Tag JSON payload requests for triage

Combine with a content type filter to single out JSON uploads in a busy capture.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HasRequestBodyFilter
    - typeKind: JsonRequestFilter
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: json-upload

Reference

hasRequestBodyFilter

Description

Select request having body.

Evaluation scope

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

responseBodyReceivedFromRemote This scope occurs the moment fluxzy received the the response body from the server. In a full streaming mode (which is the default mode), this event occurs the the full body is already sent to the client.

YAML configuration name

hasRequestBodyFilter

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 request having body.

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

.NET reference

View definition of HasRequestBodyFilter for .NET integration.

See also

This filter has no related filter

Frequently asked questions

Is this different from filtering on the POST method?

Yes. A POST without a body is still a POST, and some non standard methods send bodies. This filter matches what is actually on the wire, regardless of the verb.

When is the filter evaluated?

Fluxzy evaluates it at the response body received scope, after the body is known, which guarantees the result reflects the actual payload size.

Will it match WebSocket frames or streaming uploads?

Yes, as long as the underlying exchange carries a request body. For finer control on streaming traffic, combine it with isWebSocketFilter or method filters.

Learn more about Fluxzy rules