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.
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:
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"
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
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
Select request having body.
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.
hasRequestBodyFilter
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 |
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
View definition of HasRequestBodyFilter for .NET integration.
This filter has no related filter
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.
Fluxzy evaluates it at the response body received scope, after the body is known, which guarantees the result reflects the actual payload size.
Yes, as long as the underlying exchange carries a request body. For finer control on streaming traffic, combine it with isWebSocketFilter or method filters.