formRequestFilter is the broad form selector in Fluxzy. It is the right pick when you do not care which encoding the browser used and you just want to act on every HTML form submission that hits the proxy.
Use formRequestFilter when you want to act on classic HTML form submissions. The filter matches both encodings the browser may use:
multipart/form-data, which is what file upload forms use.application/x-www-form-urlencoded, which is what plain text forms use by default.Typical situations:
The filter evaluates on the requestHeaderReceivedFromClient scope, so it fires before the request body is forwarded. If you specifically want urlencoded forms and need to exclude multipart, use formUrlEncodedRequestFilter instead.
Simulate a slow uplink for file uploads on the asset endpoint to reproduce a customer reported timeout.
rules:
- filter:
typeKind: FilterCollection
operation: and
children:
- typeKind: PathFilter
pattern: /upload
operation: StartsWith
- typeKind: FormRequestFilter
actions:
- typeKind: AverageThrottleAction
bandwidthBytesPerSeconds: 32000
Tag every form submission in the capture so the post run report can confirm which forms were exercised by the test suite.
rules:
- filter:
typeKind: FormRequestFilter
actions:
- typeKind: ApplyTagAction
tag:
value: form-submission
Return a canned success response for any form submission to the contact endpoint while the backend mailer is being rewritten.
rules:
- filter:
typeKind: FilterCollection
operation: and
children:
- typeKind: PathFilter
pattern: /contact
operation: Exact
- typeKind: FormRequestFilter
actions:
- typeKind: MockedResponseAction
response:
statusCode: 200
body:
type: fromString
text: '{"sent":true}'
contentType: application/json
Select request sending 'multipart/form-data' or 'application/x-www-form-urlencoded' body. Filtering is made by inspecting value of Content-Type header
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
formRequestFilter
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
Retains exchanges having POST as method OR request to the host example.com.
rules:
- filter:
typeKind: FilterCollection
children:
- typeKind: PostFilter
- typeKind: HostFilter
pattern: example.com
operation: Exact
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of FormRequestFilter for .NET integration.
This filter has no related filter
formRequestFilter matches both multipart and urlencoded forms. formUrlEncodedRequestFilter only matches application/x-www-form-urlencoded.
No. The match is performed on the Content-Type request header. Fluxzy does not parse the body to make this decision.
No. Custom or vendor specific content types are not matched. Use a requestHeaderFilter with a Content-Type pattern if you need to cover them.
Yes. Wrap it in a filterCollection with a postFilter or putFilter when you also need to constrain the method.