Using Requestly to Toggle Feature Flags

What Are Feature Flags?
Why Use Feature Flags?
- Controlled Rollouts: Gradually release a feature to a small user segment before expanding access more broadly.
- A/B Testing and Experiments: Run experiments by exposing different users to different versions of a feature and measure performance or engagement.
- Continuous Deployment: Deploy code regularly without exposing unfinished features, allowing faster iteration and safer releases.
- Quick Hotfixes: Instantly disable a feature if it’s causing issues, without needing to roll back the entire application.
- Personalized User Experiences: Target features to specific users, regions, or environments for customized experiences.
The Challenge of Testing Feature Flags
- How a page behaves with certain flags on or off
- Whether specific users are seeing the right feature versions
- How the app handles fallback states
How Requestly Helps You Test Feature Flags
Requestly is a powerful tool that lets you modify HTTP requests and responses directly from your browser or desktop app. You can inject headers, change cookie values, redirect traffic, or modify responses, all without touching backend configurations.
This makes it especially useful for testing feature flags that are controlled by request headers or cookies.
How To Simulate Header-Based Feature Flag ?
Step 1: Open Requestly
Install the Requestly browser extension or open the desktop app.
Step 2: Create a Modify Header Rule
Set up a rule like this:
- Rule Type: Modify HTTP Headers ( select request header )
- URL Pattern: Match your app’s domain (for example,
https://your-app.com/*
) - Header Name: The feature flag header name (for example,
X-Feature-Flag
) - Header Value: The feature you want to enable (for example,
FEATURE_FOO_BAR
)
Step 3: Save and Enable the Rule
Once active, this will inject the feature flag header into your requests, allowing you to simulate the feature being turned on.
Step 4: Test Without the Feature Flag
To test the application without the feature flag, simply disable the rule or delete it and refresh the page.
What About Cookie-Based Feature Flags?
As of now, Requestly doesn’t have a dedicated rule type specifically for modifying cookies directly. However, you can still override or insert cookie values by following a simple workaround.
Check out this step-by-step guide on how to modify cookies using Requestly:
https://docs.requestly.com/guides/how-to-modify-cookies-using-requestly
This method works similarly to modifying headers but targets cookies instead, letting you manage cookie-based feature flags effectively.
Want to Learn More About HTTP Headers?
Here are some helpful resources to deepen your understanding:
Contents
Subscribe for latest updates
Share this article
Related posts


