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

changeRequestMethodAction Action

Rewrite the HTTP method of matching requests on the fly, useful for testing servers under unexpected verbs or working around clients you cannot modify.

Sometimes the client and the server cannot agree on a verb. A new API expects PATCH, but the SDK only ships with POST. A debugging tool wants to exercise DELETE without you writing a wrapper script. changeRequestMethodAction rewrites the method between the two so the rest of your stack keeps working unchanged.

When to use this action

Use changeRequestMethodAction when you need to rewrite the verb of a request before it reaches the upstream server. The body and headers are kept, only the method changes.

Typical situations include:

  • Probing how a server behaves under verbs it does not officially document, like PATCH or DELETE.
  • Letting a legacy client that only knows POST talk to a modern API that expects PUT or PATCH.
  • Testing CSRF protections that depend on the method.
  • Reproducing a bug report that mentions a specific verb without modifying the calling tool.

The action evaluates on requestHeaderReceivedFromClient, so it runs early in the pipeline. Combine with methodFilter and pathFilter to scope the rewrite tightly.

Real world examples

Rewrite POST to PATCH for one endpoint

Useful for a client that only supports POST while the API expects partial updates over PATCH.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HostFilter
      pattern: api.example.com
    - typeKind: PathFilter
      pattern: /v1/users/
    - typeKind: PostFilter
  actions:
  - typeKind: ChangeRequestMethodAction
    newMethod: PATCH

Promote GET to DELETE for a destructive endpoint test

Some servers misbehave when an idempotent verb is replaced with a destructive one. Combine with a strict host filter to keep the experiment safe.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HostFilter
      pattern: staging.api.example.com
    - typeKind: PathFilter
      pattern: ^/v1/items/
      operation: Regex
    - typeKind: GetFilter
  actions:
  - typeKind: ChangeRequestMethodAction
    newMethod: DELETE

Combine with header rewriting for full method change

Some servers care about Content-Type when promoting GET to POST. Add a header in the same rule so the request is acceptable to the upstream.

rules:
- filter:
    typeKind: PathFilter
    pattern: /v1/search
  actions:
  - typeKind: ChangeRequestMethodAction
    newMethod: POST
  - typeKind: AddRequestHeaderAction
    headerName: Content-Type
    headerValue: application/json

Reference

changeRequestMethodAction

Description

Alter the method of an exchange.

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

changeRequestMethodAction

Settings

The following table describes the customizable properties available for this action:

Property Type Description DefaultValue
newMethod string

Example of usage

The following examples apply this action to any exchanges

Change request method PATCH.

rules:
- filter:
    typeKind: AnyFilter
  actions:
  - typeKind: ChangeRequestMethodAction
    newMethod: PATCH

.NET reference

View definition of ChangeRequestMethodAction for .NET integration.

See also

The following actions are related to this action:

Frequently asked questions

Does Fluxzy adjust the request body when I change the method?

No. The body, headers, and path are untouched. If the new verb expects a body and the old one did not have one, you need to add it with another action or accept that the upstream will reject the request.

Are HTTP/2 pseudo headers updated correctly?

Yes. Fluxzy updates the :method pseudo header consistently so the change works across HTTP/1.1, HTTP/2, and HTTP/3.

Can I use a custom verb that is not in the standard?

Yes. The action does not validate the verb. Servers will reject unknown methods, but if you control the upstream you can use anything that parses as an HTTP token.

How do I avoid changing the method on responses to that request?

The action only rewrites the request method. Responses are not affected by this rule.

Learn more about Fluxzy rules