Skip to content

Latest commit

 

History

History
173 lines (131 loc) · 3.34 KB

File metadata and controls

173 lines (131 loc) · 3.34 KB

Requestly

HTTP interceptor and API client for request modification, mocking, and debugging.

GitHub Education Access

Claim your free access at GitHub Education Pack - look for Requestly.

Dashboard

Features

  • Request Modification: Redirect URLs, modify headers
  • API Mocking: Mock API responses without backend
  • Request Blocking: Block specific requests
  • API Client: Test APIs (Postman alternative)
  • Session Recording: Debug production issues
  • GraphQL Support: Schema introspection, auto-complete

Installation

Browser Extension

Desktop App

Download from https://requestly.io/desktop/

Quick Start

Redirect URLs

// Rule: Redirect API to local
Source: https://api.production.com/*
Destination: http://localhost:3001/$1

Modify Headers

// Add auth header to all requests
Header: Authorization
Value: Bearer your_token_here

Mock API Response

// Return mock data without backend
URL: https://api.example.com/users
Response: {
  "users": [
    { "id": 1, "name": "John" },
    { "id": 2, "name": "Jane" }
  ]
}

Configuration

Copy from templates/requestly/:

  • requestly-rules.json - Exportable rules

Export/Import Rules

  1. Create rules in Requestly
  2. Select rules → Export as JSON
  3. Share with team or commit to repo
  4. Team members import the JSON

Common Rules

Development Redirects

{
  "name": "Local API Development",
  "source": {
    "operator": "Contains",
    "value": "api.production.com"
  },
  "destination": "http://localhost:3001"
}

CORS Bypass

{
  "name": "Add CORS Headers",
  "headers": [
    {
      "header": "Access-Control-Allow-Origin",
      "value": "*",
      "type": "response"
    }
  ]
}

Block Analytics

{
  "name": "Block Analytics",
  "source": {
    "operator": "Contains",
    "value": "google-analytics.com"
  },
  "action": "block"
}

Delay Requests

{
  "name": "Simulate Slow Network",
  "source": {
    "operator": "Contains",
    "value": "/api/"
  },
  "delay": 2000
}

API Client

REST API Testing

  1. Open API Client tab
  2. Create new request
  3. Set method, URL, headers, body
  4. Send and inspect response

Pre/Post Request Scripts

// Pre-request: Set dynamic values
pm.request.headers.add({
  key: "X-Timestamp",
  value: Date.now().toString()
});

// Post-request: Log response
console.log(pm.response.json());

Best Practices

  1. Organize rules: Group by project or feature
  2. Use environments: Separate dev/staging/prod configs
  3. Share with team: Export and commit rules to repo
  4. Disable in production: Turn off rules when testing prod
  5. Mock during frontend dev: Don't wait for backend

Session Recording

  1. Enable Session Recording
  2. Reproduce the issue
  3. Share session link with team
  4. Debug network requests and responses

Resources