Is there a way to modify an HTTP request in Chrome or Firefox?

49,440

Solution 1

This might help in some cases - use fetch command to send another, tampered, request. here's how to do it in Chrome:

  1. open DevTools, tab Network
  2. clear
  3. create your request normally
  4. right click that request and select Copy > Copy as fetch
  5. go to Console tab and paste
  6. tamper the data and hit Enter

steps 1-4steps 5-6

Solution 2

There are many tools/ extensions in Chrome and Firefox which allow you to modify network requests.

One such example is Requestly. Using Requestly you can do the following tasks:

  1. Redirect network requests.
  2. Block websites or specific requests.
  3. Switch domains using Replace Rule.
  4. Modify Headers
  5. Modify UserAgent Documentation1 Documentation 2
  6. File Library (Host JS, CSS, JSON) and use them in Requestly rules

There are more features but for your specific use case. You can host your js or css on library and redirect to it using Redirect Rule. If you have URL rewriting requirement, then you can use either Redirect or Replace rule.

I won't say Requestly is as powerful as Fiddler or Charles but I'd say that it is pretty close with much simplistic UI.

Disclaimer: I built Requestly!

Solution 3

You can use tweak chrome extension and you'll be able to do exactly that, intercept and modify HTTP requests.

Share:
49,440
J. Lin
Author by

J. Lin

Updated on July 09, 2022

Comments

  • J. Lin
    J. Lin almost 2 years

    Is there a way to modify an HTTP request using Chrome dev tools or Firebug? For example when developing locally and testing in Chrome, I have a page that needs an HTTP request to fill some data. Because it's local, that service isn't available.

    Currently the only way of getting around the problem is configuring a proxy pass in Apache so it hits a QA environment for that call. I'm looking or a simpler way to achieve this because I use Jetty to test the app and can't configure a proxy pass (or that I know of).

    In other words, is there a way to create a temporary proxy pass for the current session when testing an app locally?