Skip to main content
Back to Products
vscode

DotFetch

HTTP client for VS Code with environments, scripts and tests

0 stars0 forks0 issues3,456 downloadsVersion v2.2.0VSX 2.2.0
๐Ÿ“š Docs
DotFetch โ€ข READMEโ€ข9 min read

๐Ÿš€ DotFetch

Professional HTTP Client for VS Code

Modern API Testing Made Simple

Version VS Code License

๐Ÿ“ฅ Marketplace โ€ข ๐ŸŒ Open VSX โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ› Report Issues


โœจ What is DotFetch?

DotFetch is an HTTP client that lives inside VS Code. Build a request, press Send, and read the response, without leaving your editor or copying secrets into a separate app.

๐ŸŽฏ Key Benefits:

  • Native VS Code Integration - Request Builder tab, sidebar views, and keyboard shortcuts that only fire in the Request Builder
  • Environment Variables - Your .env files become environments, with {{VARIABLE}} substitution everywhere
  • Comprehensive Authentication - API Key (Header & Query), OAuth 2.0 Client Credentials, Bearer Token, and Basic Auth
  • Scripts & Tests - JavaScript before and after each request: sign requests, chain tokens, test responses
  • Secrets Stay Out of Storage - Passwords, tokens, and keys are never saved to History or Collections; {{VARIABLE}} references are
  • Performance & Memory Protected - 10 MB response limit and a display guard for responses over 1 MB

New in v2.2.0: Pre-Request and Post-Response scripts with test() / assert(), crypto helpers for request signing, a wire-exact request pipeline (bodies and query strings sent byte for byte), status-coloured History, and full documentation.


๐Ÿš€ Quick Start

Installation

  1. Install from VS Code Marketplace:

    Ctrl+P โ†’ ext install FreeRave.dotfetch
  2. Or search in Extensions:

    • Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac)
    • Search for "DotFetch"
    • Click Install

Your First Request

  1. Open DotFetch: click the DotFetch icon in the Activity Bar, then New Request (or Ctrl+Shift+P โ†’ "New Request")
  2. Enter URL: https://jsonplaceholder.typicode.com/posts/1
  3. Select Method: GET, POST, PUT, PATCH, DELETE, HEAD, or OPTIONS
  4. Send Request: click Send or press Ctrl+Enter / Cmd+Enter

๐Ÿ“– Get Started guide: first request, first POST, first .env variable, in five minutes.


๐ŸŽจ Features

๐Ÿ”ง Core HTTP Client

Complete HTTP & Auth Support

  • โœ… All HTTP Methods (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
  • โœ… API Key Auth (Header or Query Parameter with live preview)
  • โœ… OAuth 2.0 (Client Credentials flow with โšก direct token fetching)
  • โœ… Bearer Token & Basic Auth (with {{ENV}} variable substitution)
  • โœ… Show/Hide Secret Toggles (๐Ÿ‘๏ธ / ๐Ÿ™ˆ)
  • โœ… SSL Toggle for https://localhost / self-signed certs
  • โœ… Raw request body (JSON, text, URL-encoded form), sent byte for byte
  • โœ… Key-value Headers & Query Parameters with on/off toggles
  • โœ… Per-request Timeout & Network Retry

Request Management

  • โœ… Collections with one-click Save & Load
  • โœ… Favorites for one-click access
  • โœ… Templates collection for reusable starting points
  • โœ… History with ๐ŸŸข success / ๐Ÿ”ด failure / ๐ŸŸก in-flight status
  • โœ… Request validation before sending

Response Analysis & Protection

  • โœ… Pretty (syntax-highlighted JSON) and Raw views
  • โœ… Response Headers Inspector (dedicated key-value table)
  • โœ… Tests tab with pass/fail results
  • โœ… Visual Payload Size & Time measurement
  • โœ… Large Response Guard (protection against huge payloads)
  • โœ… Clear error messages & cancellation support

๐ŸŒ Environment Variables

Multi-Environment Support

  • โœ… .env, .env.local, .env.development, .env.staging, .env.production, .env.test, or any .env.<name>
  • โœ… Automatic detection and live reload when a file changes
  • โœ… One-click environment switching

Variable Substitution

  • โœ… {{VARIABLE_NAME}} in URL, params, headers, body, and auth
  • โœ… Nested variables (API_URL={{BASE_URL}}/v2)
  • โœ… Hint when you use variables with no active environment

Environment Tree View

  • โœ… VS Code sidebar integration
  • โœ… Variable explorer
  • โœ… Copy value, name, or {{VARIABLE}}
  • โœ… Search variables across environments

๐Ÿ“– Environments guide

โš™๏ธ Scripts & Tests (v2.2.0)

Run JavaScript before a request and after its response: sign requests, chain tokens between requests, and test every response.

JS
// Pre-Request: sign the exact body that will be sent
const body = dotfetch.env.resolve(dotfetch.request.body);
dotfetch.request.headers['X-Signature'] = dotfetch.crypto.hmac('sha256', dotfetch.env.get('API_SECRET'), body);
JS
// Post-Response: test the response and save the token for the next request
test('Login succeeded', () => assert(dotfetch.response.status === 200, `Got ${dotfetch.response.status}`));
dotfetch.env.set('ACCESS_TOKEN', dotfetch.response.json().token);
  • โœ… dotfetch.request / dotfetch.response: read and change params, headers, and body
  • โœ… dotfetch.env: session variables that never touch your .env files
  • โœ… test() / assert(): results in a dedicated Tests tab
  • โœ… dotfetch.crypto / dotfetch.utils: SHA-256, HMAC, UUID, random nonces, UTF-8 Base64
  • โœ… Fails closed: a failing Pre-Request script stops the request before it is sent

๐Ÿ“– Scripting guide ยท Copy-paste examples

๐Ÿ“ Collections & Organization

  • โœ… Request Collections - Group requests by project or feature
  • โœ… Request Notes - Keep documentation next to each request
  • โœ… Duplicate, Edit & Delete - Manage requests from the sidebar
  • โœ… Stored outside your project - Collections and History live in VS Code's extension storage, not in Git

๐Ÿ“– Collections, Favorites & History guide

๐Ÿ”„ cURL Import/Export

cURL Export

  • โœ… Method, URL, params, headers, auth, and body
  • โœ… -u for Basic Auth, -k when SSL verification is off
  • โœ… One-click copy to clipboard

cURL Import

  • โœ… -X, -H, -d / --data / --data-raw / --data-binary
  • โœ… Query string split into the Params tab
  • โœ… Multi-line commands with \

๐Ÿ“– cURL guide

๐ŸŽจ Professional UI/UX

  • โœ… Native Theme - Follows VS Code's active colour theme
  • โœ… Method Color Coding - Visual HTTP method distinction
  • โœ… Loading States - Visual feedback for sending, retrying, and token fetching
  • โœ… Smart Request Indicators - Active counts/dots for Params, Headers, Auth, Body, Scripts, and Notes
  • โœ… Non-Destructive Row Toggles - Disable Params or Headers without deleting their values
  • โœ… Inline Copy Feedback - Green โœ“ Copied state only after successful clipboard writes
  • โœ… Toast System - Stacked in-WebView feedback with a maximum of three visible notifications

โŒจ๏ธ Keyboard Workflow

  • Ctrl+Enter / Cmd+Enter โ€” Send (press again to cancel)
  • Alt+D โ€” Focus and select the URL field
  • Ctrl+Alt+S / Cmd+Alt+S โ€” Save Request to Collection
  • Ctrl+Shift+Backspace / Cmd+Shift+Backspace โ€” Clear Request Form
  • ? โ€” Toggle Keyboard Shortcuts Help
  • Escape โ€” Close Active Modal

Shortcuts are registered as native VS Code keybindings scoped to the DotFetch Request Builder, so they never fire while another editor or panel is active.


๐Ÿ“ธ Screenshots

Main Interface

DotFetch Main InterfaceDotFetch Main Interface

Environment Variables

Environment Variables PanelEnvironment Variables Panel

Request Collections

Collections ManagementCollections Management

cURL Import/Export

cURL Import ExportcURL Import Export

๐Ÿ› ๏ธ Configuration

Extension Settings

SettingDefaultDescription
dotfetch.timeout10000Default timeout in milliseconds for new requests (1000โ€“300000)
dotfetch.retryCount0Default retries when the server can't be reached (0โ€“5)
dotfetch.sslVerifytrueVerify SSL/TLS certificates by default
dotfetch.maxHistory50Maximum number of requests kept in History

Timeout, retries, and SSL verification are defaults: each request can override them in its โš™๏ธ tab.

Environment Files

DotFetch detects .env* files in your workspace root:

CODE
.env                  โ†’ default
.env.local            โ†’ local
.env.development      โ†’ development   (.env.dev works too)
.env.staging          โ†’ staging       (.env.stage works too)
.env.production       โ†’ production    (.env.prod works too)
.env.test             โ†’ test

Files ending in .example, .sample, .template, .schema, .lock, .bak, .swp, or ~ are ignored.


๐Ÿ“– Documentation

The full guide lives in docs/:


๐Ÿ”ง Development

Prerequisites

  • Node.js 18+
  • VS Code 1.80+

Building & Verification

BASH
# Install dependencies
npm install

# Development build (watch mode)
npm run watch

# Build (bundles extension and webview)
npm run compile

# Type check
npm run typecheck

# Lint code
npm run lint

# Build, lint, and run the test suite in VS Code
npm test

Project Structure

CODE
dotfetch/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ extension.ts          # Extension entry point, commands & activation
โ”‚   โ”œโ”€โ”€ webviewPanel.ts       # WebView lifecycle, message routing & History recording
โ”‚   โ”œโ”€โ”€ requestService.ts     # Request pipeline: scripts, substitution, auth, axios, OAuth
โ”‚   โ”œโ”€โ”€ scriptRunner.ts       # Pre/Post script runtime (vm), dotfetch.* APIs, test()/assert()
โ”‚   โ”œโ”€โ”€ environmentManager.ts # .env discovery, parsing, session overlay & {{VAR}} substitution
โ”‚   โ”œโ”€โ”€ dataManager.ts        # GlobalState persistence (History, Collections, Favorites)
โ”‚   โ”œโ”€โ”€ logger.ts             # DotFetch Output channel
โ”‚   โ”œโ”€โ”€ mainSidebar.ts        # Quick Actions & Favorites tree
โ”‚   โ”œโ”€โ”€ collectionTree.ts     # Collections tree
โ”‚   โ”œโ”€โ”€ historyTree.ts        # History tree (status-coloured)
โ”‚   โ”œโ”€โ”€ environmentTree.ts    # Environments tree
โ”‚   โ”œโ”€โ”€ utils/                # cURL parser & security helpers
โ”‚   โ”œโ”€โ”€ webview/              # Webview frontend (bundled to media/script.js)
โ”‚   โ”‚   โ”œโ”€โ”€ main.js           # Coordinator & message handling
โ”‚   โ”‚   โ”œโ”€โ”€ request.js        # Request assembly, load/save & settings
โ”‚   โ”‚   โ”œโ”€โ”€ auth.js           # Auth flows & live previews
โ”‚   โ”‚   โ”œโ”€โ”€ ui.js             # Tables, response tabs, headers & tests inspector
โ”‚   โ”‚   โ”œโ”€โ”€ curl.js           # cURL import/export
โ”‚   โ”‚   โ”œโ”€โ”€ shortcuts.js      # Keyboard shortcuts
โ”‚   โ”‚   โ”œโ”€โ”€ state.js          # Webview state & persistable auth schema
โ”‚   โ”‚   โ””โ”€โ”€ api.js            # postMessage bridge
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ””โ”€โ”€ extension.test.ts # Test suite
โ”œโ”€โ”€ media/                    # Webview HTML/CSS, compiled bundle, icons & screenshots
โ”œโ”€โ”€ docs/                     # User documentation
โ”œโ”€โ”€ package.json              # Extension manifest & settings
โ””โ”€โ”€ CHANGELOG.md              # Release notes

๐Ÿค Contributing

Contributions are welcome. See the Contributing Guide for details.

  1. Fork the repository
  2. Clone your fork:
    BASH
    git clone https://github.com/<your-username>/DotFetch.git
    cd DotFetch
  3. Install dependencies: npm install
  4. Start the watcher: npm run watch
  5. Open in VS Code and press F5 to launch an Extension Development Host

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • VS Code Team for the amazing extension platform
  • Axios for the reliable HTTP client
  • Our Community for feedback and contributions

๐Ÿ“ž Support


Made with โค๏ธ for the developer community

โญ Star us on GitHub โ€ข ๐Ÿ› Report Bug โ€ข ๐Ÿ’ก Request Feature

Related Products

โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ
โ€Œ