How to modify Query parameters in URL

Contents

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.

Share this article:

This article was written by:

Picture of Sagar Soni

Sagar Soni

Sagar is the co-founder and CTO of Requestly. When he's not busy architecting the next big thing in software development, you'll likely find him behind the wheel, cruising the streets and enjoying the thrill of the drive. For Sagar, it's all about the code by day and the open road by night.