Modifying HTTP Requests in Firefox Network Monitor
This article explores the Edit and Resend feature within the Firefox Web Browser's Network Monitor, detailing how it empowers developers to intercept, modify, and replay HTTP requests directly from the browser. You will learn the step-by-step process for accessing this tool, altering HTTP headers and request payloads, and analyzing the resulting server responses to streamline API debugging and web application testing.
Accessing the Edit and Resend Feature
To modify a network request, you first need to capture it in the Network Monitor.
- Open Firefox and press
F12(orCmd+Option+Ion macOS) to launch the Developer Tools. - Select the Network tab.
- Reload the page or trigger the specific action on the website that generates the HTTP request you want to inspect.
- Locate the target request in the network log, right-click on it, and select Edit and Resend from the context menu.
This opens a new configuration pane on the side of the Network Monitor, populating it with the exact data from the original request.
Modifying HTTP Headers
The Edit and Resend pane provides full control over the metadata sent to the server. In the Headers section, all original request headers are displayed as editable fields.
- Editing Existing Headers: Click directly into the
value field of any header to change it. This is commonly used to test
different
Authorizationbearer tokens, modifyCookievalues to simulate different user sessions, or change theUser-Agentto test mobile responsiveness. - Adding New Headers: Scroll to the bottom of the
headers list to find empty input fields. Here, you can type a new header
name and value, such as a custom
X-API-KeyorCache-Controldirective. - Removing Headers: Clear the text from a header or use the delete icon next to it to remove it entirely. This helps developers verify how a server responds when expected headers are omitted.
Altering the Request Body
For requests that transmit data to the server—such as
POST, PUT, and PATCH requests—the
Edit and Resend tool provides a Body (or Request
Payload) text area.
This field contains the raw data sent in the original request, such as a JSON object, XML payload, or URL-encoded form data. Developers can click into this text area and freely modify the content. You can change variable values, add new JSON keys, or intentionally break the syntax to test the server's error-handling capabilities.
When you modify the request body, you do not need to manually update
the Content-Length header. Firefox automatically
recalculates the byte size of your new payload and updates the header
accordingly when the request is dispatched.
Changing the Request Method and URL
At the top of the Edit and Resend pane, you can also manipulate the fundamental routing of the request:
- HTTP Method: Use the dropdown menu to switch the
request method (for example, changing a
GETrequest to aPOSTorDELETErequest) to test how an endpoint handles different types of operations. - URL: Click into the URL bar to change the target endpoint, add query parameters, or alter existing path variables.
Sending and Analyzing the Request
Once you have finished editing the HTTP headers and the request body, click the Send button at the top of the pane.
Firefox immediately dispatches the modified request to the server without requiring you to interact with the webpage's user interface. A new entry will appear in the Network Monitor list representing your custom request. You can click on this new entry to inspect the server's response status code, response headers, and response body to verify the outcome of your changes.