Back
June 30, 2023
Product Features
3
min read

How to modify Query parameters in URL

Rohan Mathur
Dev @ Requestly
On this page

Query Parameters are an important part of a URL. When you want to pass data in an HTTP GET request, the data is sent as query parameters.

Most e-commerce websites implement filtering and sorting through query parameters, we can update those values and check how the server responds. Query parameters are also used in implementing pagination and allow’s users to bookmark or share specific states or views of an application.

Use Cases:

  1. Remove UTM tracking parameters.
  2. Testing the server’s behavior by passing different query parameters.
  3. Sending additional Information to some API calls to inform your backend & database that this is internal testing.

Modifying Query parameters using Requestly browser extension

Query Params rule can be used to perform the following modifications on a given URL:

  1. Add new query parameters.
  2. Remove a specific query parameter.
  3. Remove all parameters.

In this example, we will see how to load iPhone results whenever you search for Samsung on Amazon.

  1. Download and Install the Requestly Chrome extension.
  2. Click on Create your first rule.
  3. Then select Query Param and click on Create rule.
  4. Enter the Amazon query that lists down the Samsung mobile: https://www.amazon.in/s?k=samsung+mobile&i=electronics
  5. Add the param and it’s value as iphone.
  6. Click Create Rule to save the rule.

After saving the rule successfully, you can see that Amazon loads iphone when

NOTE: If you already have a query parameter in the URL and you are adding the same parameter, then the Requestly rule will overwrite the value of that specific query param.

Requestly is an Open-Source frontend development platform with essential tooling & integrations that helps frontend developers write, test & debug their code 10x faster. Using Requestly, you can create mock API endpoints, test, validate & override API responses, modify request & response headers, setup redirects (Map local, Map remote) and use Requestly sessions for faster debugging.

SHARE THIS POST

Ready to get started?

Empowering frontend developers to achieve more in development, testing & debugging workflows.