Match and Replace can change contents of proxied requests and responses. This can be useful while developing a client application and testing its behavior with certain server data. It can also alter functionality of client applications by overwriting data they send to the server API.

Editing rules

Match and Replace rules can be added, removed and reordered using the rules list. You can make duplicates of existing rules.

Use Add Match Rule menu action to add rule for a request in History tool. It will automatically fill in the protocol, method, host and URI fields to get you started.

Rules can perform the following actions:

  • Set Flag assigns a flag to all matching messages
  • Edit request or response and then forward it to its destination
  • Respond to a request with a custom response without sending it to the remote server
  • Drop request or response without forwarding it

Editing a request or a response has multiple options:

  • URI tab allows you to keep original URI, replace it with a custom URI, or replace a matching range of URI with a new value. Replacement supports regular expressions such as /userId=[^&]*/.
  • Headers list lets you add update HTTP headers. If there is no header with that name it is added. If a header for that name exists its value is updated. If you leave the value field empty, any existing header with that name will be removed.
  • Body tab allows you to keep original body data, replace it with custom text, or replace a matching range of the body text with a new value. Replacement supports regular expressions such as /userId=[^&]*/.