Modifying Traffic
Fiddler Everywhere provides powerful debugging techniques for testing APIs and mocking server and client behavior. Modifying traffic is a crucial part of the Fiddler Composer and Rules tabs.
Composing Requests
Instead of testing your API or a website through the UI and making multiple clicks, you can reload the desired session in the Composer tab, make edits to the desired values, and re-execute the request.
To load and modify captured session through the Composer:
Start any capturing mode with Fiddler Everywhere and initiate the request. As a result, the session is captured and displayed in the Live Traffic list.
-
Select the desired session and right-click to open the context menu. From the context menu, select Edit in Composer. Alternatively, select the session and use the keyboard shortcut by pressing the
E
key. -
The session opens in a new Composer window, and then you can change the desired values. For example, change the data payload, modify the headers, test the authentication, etc.
To modify a header, select it and change the needed key-value pair. You can add a new header by using the top key-value row. By default, the top key-value row is empty and can receive new values. Once you have modified or added a new header, click the confirmation button (a tick) to the right to apply the changes.
Click Execute.
This approach enables you to modify an existing request in the same way your application does it. In the Live Traffic list, you can find the newly executed request and the response from the server.
Additional Composer Resources
- Composing Requests with Basic Authentication
- Composing SOAP Requests
- Capturing and Inspecting iOS Traffic
- Capturing and Inspecting Android Traffic
Using Rules
One of the most powerful features in Fiddler Everywhere resides in the Rules tab. You can create rules that change HTTP Requests & Responses on-the-fly based on different criteria. The rules can combine multiple criteria and apply single or multiple actions, allowing you to mock real-life scenarios with a few clicks. The various combination of matching conditions and actions that can be combined and applied into single or multiple rules enables you to test client and server applications without changing or accessing their codebase.
To modify captured session through the Rules:
Start any capturing mode with Fiddler Everywhere and initiate the request. As a result, the session is captured and displayed in the Live Traffic list.
-
Select the desired session and right-click to open the context menu. From the context menu, select Add New Rule.
-
The session data is automatically populated in the Rules Builder. You can further modify the matching conditions and the desired actions.
Click Save to preserve the rule.
Fiddler automatically adds the newly created rule on the top of the Rules Queue, giving it immediate execution priority (you can demote or promote each rule in the queue). The rule is also automatically activated (the rule switch is toggled on), so any new requests that match the rule will be affected by it. You can also replay the original session through its context menu (Replay > Reissue Requests).