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.
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:
The filter evaluates on the requestHeaderReceivedFromClient scope. Combine it with hostFilter, pathFilter or a filterCollection to scope it to a specific API surface.
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
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
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
Select exchanges according to request method.
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
putFilter
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 exchanges according to request method.
rules:
- filter:
typeKind: PutFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of PutFilter for .NET integration.
The following filters are related to this filter:
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.
It matches any request whose HTTP method is PUT, regardless of the protocol on top. WebDAV and S3 style uploads are matched too.
Yes, set inverted: true. The rule then fires for every exchange whose method is not PUT.
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.