A powerful HTTP client extension for Zed that brings professional API testing directly into your editor. Send HTTP requests, view formatted responses, manage environments, and chain requests—all without leaving your development workflow.
Inspired by the popular VS Code REST Client extension.
git clone https://github.com/ogdev-01/zed-restclient.git && cd zed-restclient && ./install-dev.shThen restart Zed (Cmd+Q and reopen).
- 🚀 Full HTTP Support - All HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD)
- 📝 Simple Syntax - Write requests in plain text
.httpor.restfiles - 🎨 Beautiful Responses - Auto-formatted JSON, XML, and HTML with syntax highlighting
- 🔄 Request Chaining - Capture response values and use in subsequent requests (JSONPath)
- 🌍 Environment Management - Switch between dev, staging, and production with one command
- 📦 Powerful Variables - System variables (
{{$guid}},{{$timestamp}}), environment vars, and custom variables - 🔐 Secure Secrets - Use environment variables to keep API keys out of version control
- ⚡ Code Generation - Generate JavaScript, Python code from your requests
- 🌐 GraphQL Ready - Full GraphQL query and mutation support
- 🔧 cURL Integration - Import cURL commands, export requests as cURL
- 💡 Smart LSP Features - Code lenses, auto-complete, hover hints, real-time diagnostics (Learn more)
- 📜 History Tracking - Automatic request/response history
- Installation
- Quick Start
- Basic Usage
- Documentation
- Configuration
- Examples
- LSP Features
- Keyboard Shortcuts
- Troubleshooting
- Migration from VS Code
- Contributing
Before installing the extension, you need to have Rust installed on your system.
If you don't have Rust installed, install it using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFor Windows, download and run the installer from rustup.rs.
After installation, add the WebAssembly target:
rustup target add wasm32-wasip1Verify your installation:
rustc --version
cargo --versionYou should see version numbers for both commands.
The extension requires building both WASM and a native LSP server binary.
-
Clone this repository:
git clone https://github.com/ogdev-01/zed-restclient.git cd zed-restclient -
Run the installation script:
# macOS/Linux ./install-dev.sh # Windows (PowerShell) .\install-dev.ps1
The script will automatically:
- Check if Rust and Cargo are installed
- Install the
wasm32-wasip1target if not present - Build the LSP server and WASM extension
- Copy files to the correct Zed directories
-
Verify the installation (optional but recommended):
./verify-installation.sh
This will check that all files are in the correct locations.
-
Completely quit and restart Zed (Cmd+Q on macOS, Alt+F4 on Windows/Linux)
⚠️ IMPORTANT: Don't just close the window - fully quit the application- On macOS: Use Cmd+Q or Zed menu → Quit Zed
- On Windows/Linux: Use Alt+F4 or File → Exit
-
Verify the extension appears in Zed:
- Open command palette (
Cmd+Shift+PorCtrl+Shift+P) - Type "zed: extensions"
- Look for "REST Client" in the installed extensions list
- If you don't see it, see Extension Not Appearing below
- Open command palette (
- ✅ Verifies Rust and Cargo are installed
- ✅ Automatically installs
wasm32-wasip1target if missing - ✅ Builds the LSP server binary (native, ~3.8MB with
reqwest) - ✅ Builds the WASM extension (~1.7MB)
- ✅ Copies all files to Zed's extension directories (
installed/andwork/) - ✅ Sets correct permissions on the LSP server binary
If you prefer to build manually:
cargo build --target wasm32-wasip1 --release- Install the extension in Zed by copying it to your extensions directory
See Installation Guide for detailed build instructions and development setup.
Create a file named api-test.http:
### Get GitHub user
GET https://api.github.com/users/octocat
### Create a post
POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json
{
"title": "My Post",
"body": "This is the content",
"userId": 1
}- Click the "Send Request" button that appears above each request
- Or use the command palette:
Cmd+Shift+P→ "rest-client: send request" - View the formatted response in a split pane
Create .http-client-env.json in your workspace root:
{
"development": {
"baseUrl": "http://localhost:3000",
"apiKey": "dev-key-123"
},
"production": {
"baseUrl": "https://api.example.com",
"apiKey": "{{$processEnv PROD_API_KEY}}"
}
}Use in your requests:
GET {{baseUrl}}/users
Authorization: Bearer {{apiKey}}Switch environments:
/switch-environment production
👉 New to the extension? Check out the Getting Started Guide for a complete walkthrough.
The REST Client extension can be customized through Zed settings. Add configuration to your settings.json:
{
"rest-client": {
"timeout": 30000,
"validateSsl": true,
"historyLimit": 1000,
"responsePane": "right",
"defaultHeaders": {
"User-Agent": "Zed-REST-Client/1.0"
}
}
}Minimal GET request:
GET https://api.example.com/usersOr even simpler (GET is assumed):
https://api.example.com/usersPOST with JSON:
POST https://api.example.com/users
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com"
}With headers:
GET https://api.example.com/data
Accept: application/json
Authorization: Bearer YOUR_TOKEN
User-Agent: MyApp/1.0Multiple requests in one file:
### Get all users
GET https://api.example.com/users
### Create a user
POST https://api.example.com/users
Content-Type: application/json
{
"name": "Jane Doe"
}
### Get specific user
GET https://api.example.com/users/123Use ### to separate requests.
File variables:
@baseUrl = https://api.example.com
@apiVersion = v1
GET {{baseUrl}}/{{apiVersion}}/usersSystem variables:
POST {{baseUrl}}/events
Content-Type: application/json
{
"id": "{{$guid}}",
"timestamp": {{$timestamp}},
"datetime": "{{$datetime iso8601}}"
}Environment files (.http-client-env.json):
{
"development": {
"baseUrl": "http://localhost:3000"
},
"production": {
"baseUrl": "https://api.example.com"
}
}Switch with: /switch-environment production
Capture values from responses:
### Login
POST {{baseUrl}}/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "secret"
}
# @capture authToken = $.token
### Use the token
GET {{baseUrl}}/protected
Authorization: Bearer {{authToken}}| Guide | Description |
|---|---|
| Getting Started | Complete beginner's guide with examples |
| Features | Detailed explanation of all features |
| Migration Guide | Moving from VS Code REST Client |
| Troubleshooting | Common issues and solutions |
| Topic | Description |
|---|---|
| Configuration | All settings, defaults, and validation |
| Variables | Variable types, syntax, and usage |
| Environments | Environment management and switching |
| Request Chaining | JSONPath, response capture, workflows |
| GraphQL | GraphQL queries and mutations |
| Code Generation | Generate code in multiple languages |
| cURL Commands | Import/export cURL |
| LSP Features | Auto-complete, diagnostics, hover |
All examples are in the examples/ directory:
basic-requests.http- Simple GET/POST/PUT/DELETEwith-variables.http- All variable typesrequest-chaining.http- Response capture and chaininggraphql-examples.http- GraphQL queries.http-client-env.json- Multi-environment setup
Add to your Zed settings.json:
{
"rest-client": {
"timeout": 30000,
"followRedirects": true,
"validateSSL": true,
"historyLimit": 1000,
"responsePane": "right",
"defaultHeaders": {
"User-Agent": "Zed-REST-Client/1.0"
}
}
}| Setting | Default | Description |
|---|---|---|
timeout |
30000 | Request timeout (milliseconds) |
validateSSL |
true | Validate SSL/TLS certificates |
followRedirects |
true | Follow HTTP redirects |
maxRedirects |
5 | Maximum redirect hops |
historyLimit |
1000 | Max requests in history |
responsePane |
"right" | Response position: "right", "below", "tab" |
defaultHeaders |
{} | Headers added to all requests |
📘 See Configuration Guide for all settings and examples.
GET https://api.github.com/users/octocatGET https://api.example.com/data
Accept: application/json
Authorization: Bearer YOUR_TOKEN_HEREPOST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json
{
"title": "My Post",
"body": "This is the post content",
"userId": 1
}Separate multiple requests with ###:
### Get all posts
GET https://jsonplaceholder.typicode.com/posts
### Create a new post
POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json
{
"title": "New Post",
"body": "Content here",
"userId": 1
}
### Get a specific post
GET https://jsonplaceholder.typicode.com/posts/1- Place your cursor anywhere within the request you want to send
- Open the command palette (
Cmd+Shift+Pon macOS,Ctrl+Shift+Pon Linux/Windows) - Search for "rest-client: send request"
- Press Enter
The response will appear in a new editor pane showing:
- HTTP status code and reason
- Response headers
- Formatted response body
- Request duration and size
Add comments to your request files using # or //:
# This is a comment
// This is also a comment
### Get user data
GET https://api.example.com/users/123METHOD URL [HTTP_VERSION]
METHOD: HTTP method (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT)URL: Complete URL including protocol (http:// or https://)HTTP_VERSION: Optional, defaults to HTTP/1.1
Headers follow the request line, one per line:
Header-Name: Header-Value
Add a blank line after headers, then include your request body:
POST https://api.example.com/data
Content-Type: application/json
{
"key": "value"
}Check the examples/ directory for complete working examples:
### Simple GET
GET https://api.github.com/users/octocat
### POST with JSON
POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json
{
"title": "My Post",
"body": "Content here",
"userId": 1
}
### With authentication
GET https://api.example.com/protected
Authorization: Bearer {{token}}
### Form data
POST https://httpbin.org/post
Content-Type: application/x-www-form-urlencoded
username=johndoe&password=secretMore examples:
The REST Client includes a powerful Language Server that provides intelligent editing features:
Clickable "▶ Send Request" buttons appear above each HTTP request. Click to execute requests instantly.
▶ Send Request
GET https://api.github.com/users/octocat
# @name CreateUser
▶ Send Request: CreateUser
POST https://api.example.com/usersType {{ to trigger smart completions for:
- Environment variables from
.http-client-env.json - System variables (
$guid,$timestamp,$datetime,$randomInt) - File variables defined in your
.httpfile
Hover over variables to see:
- Current resolved value
- Variable source (environment, file, system)
- Detailed descriptions and examples
Real-time error detection for:
- Invalid HTTP methods and malformed URLs
- Undefined variables and typos
- JSON syntax errors in request bodies
- Missing or incorrect headers
Switch between dev, staging, and production environments seamlessly:
/switch-environment productionAll variable values update automatically based on the active environment.
📘 See LSP Features Guide for complete documentation with examples and troubleshooting.
Add custom shortcuts to your Zed keymap.json:
{
"context": "Editor && (extension == 'http' || extension == 'rest')",
"bindings": {
"ctrl-alt-r": "rest-client: send request",
"ctrl-alt-e": "rest-client: switch environment",
"ctrl-alt-g": "rest-client: generate code"
}
}Available Commands:
rest-client: send request- Execute the current requestrest-client: switch environment- Change active environmentrest-client: generate code- Generate code from requestrest-client: copy as cURL- Export as cURL commandrest-client: paste cURL- Import cURL commandrest-client: save response- Save response to filerest-client: copy response- Copy response to clipboard
Error: "can't find crate for core" or "wasm32-wasip1 target may not be installed"
This means the WebAssembly target isn't installed. The install script should handle this automatically, but if you see this error:
rustup target add wasm32-wasip1Then run the install script again.
Error: "rustc: command not found" or "cargo: command not found"
Rust is not installed or not in your PATH. Install Rust:
# macOS/Linux
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Windows
# Download from https://rustup.rs/After installation, restart your terminal and try again.
Install script fails on Windows
Make sure you're running PowerShell (not Command Prompt):
.\install-dev.ps1If you get execution policy errors:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserIf the extension doesn't appear in Zed after installation:
-
Verify files were installed correctly:
./verify-installation.sh
-
Check the installation directories exist:
# macOS ls -la "$HOME/Library/Application Support/Zed/extensions/installed/rest-client/" ls -la "$HOME/Library/Application Support/Zed/extensions/work/rest-client/" # Linux ls -la "$HOME/.local/share/zed/extensions/installed/rest-client/" ls -la "$HOME/.local/share/zed/extensions/work/rest-client/"
You should see:
extension.toml,extension.wasm,lsp-server, andlanguages/ -
Ensure Zed was fully restarted:
- Don't just close the window - fully quit the application
- macOS: Cmd+Q (or Zed menu → Quit Zed)
- Windows/Linux: Alt+F4 (or File → Exit)
- Wait 2-3 seconds, then restart Zed
-
Check Zed version:
- The extension requires Zed 0.100.0 or later
- Help → About Zed to check your version
-
Check Zed logs for errors:
- Open: Help → View Error Log
- Look for errors related to "rest-client"
- Common issues include LSP server permissions or WASM loading errors
-
Try a clean reinstall:
# Remove existing installation rm -rf "$HOME/Library/Application Support/Zed/extensions/installed/rest-client" rm -rf "$HOME/Library/Application Support/Zed/extensions/work/rest-client" # Reinstall ./install-dev.sh # Restart Zed completely
-
Check LSP server permissions:
# macOS chmod +x "$HOME/Library/Application Support/Zed/extensions/installed/rest-client/lsp-server" chmod +x "$HOME/Library/Application Support/Zed/extensions/work/rest-client/lsp-server"
- Ensure you have the latest version of Zed installed (0.100.0+)
- Check the Zed logs for any error messages (Help → View Error Log)
- Completely quit Zed (Cmd+Q on macOS, Alt+F4 on Windows) and restart
- Try reinstalling the extension using the steps above
- Verify your URL is correct and includes the protocol (
http://orhttps://) - Check your internet connection
- Verify any authentication tokens or API keys are valid
- Check if the API endpoint requires specific headers
- Ensure your file has the
.httpor.restextension - Reload Zed or restart the editor
- Check if the language mode is set to "HTTP" in the status bar
Due to limitations in Zed's WASM extension HTTP client API, HTTP status codes are not returned from requests. All successful responses are reported as "200 OK (assumed)".
Workarounds:
- The LSP server (if installed) uses
reqwestwhich has full status code support - Check response headers for status-related information
- Use response body content to determine success/failure
- For critical status code checks, use an external HTTP client
The extension's tree-sitter grammar must be hosted in a separate Git repository for distribution. During development, you can use the local grammar, but for published extensions, the grammar must be accessible via a Git URL.
The LSP server binary is downloaded automatically on first use from GitHub releases. If the download fails:
- Check your network connection
- Manually download from GitHub Releases
- Place the binary in your PATH or the extension's work directory
The extension works without the LSP server, but you'll lose features like:
- Code lenses (clickable "Send Request" above each request)
- Variable autocompletion
- Hover information
- Real-time diagnostics
Request not sending?
- Ensure URL includes
http://orhttps:// - Check for syntax errors (red squiggly lines)
- Verify cursor is within the request block
Variables not resolving?
- Check variable names match exactly (case-sensitive)
- Ensure environment file exists and is valid JSON
- Use
/switch-environmentto verify active environment
SSL errors?
{
"rest-client": {
"validateSSL": false // For development only!
}
}📘 See Troubleshooting Guide for detailed solutions.
Migrating from VS Code REST Client? Your files will work as-is!
- ✅ Same
.httpfile format - ✅ Same variable syntax
{{var}} - ✅ Same environment file format
- ✅ Same request separator
### - ✅ Same system variables
📘 See Migration Guide for complete details and settings mapping.
Completed:
- ✅ Full HTTP method support
- ✅ Syntax highlighting (Tree-sitter)
- ✅ Response formatting (JSON, XML, HTML)
- ✅ Variable substitution and environments
- ✅ Request chaining with JSONPath
- ✅ GraphQL support
- ✅ Code generation (JavaScript, Python)
- ✅ cURL import/export
- ✅ LSP features (autocomplete, diagnostics)
- ✅ Configuration system
Coming Soon:
- ⏳ Request history UI
- ⏳ More code generation languages
- ⏳ Response time graphs
- ⏳ Certificate management
Contributions are welcome! Please feel free to submit issues or pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Rust toolchain (latest stable)
wasm32-wasip1target installed:rustup target add wasm32-wasip1
Build the WASM extension:
# Using the optimized build script (recommended)
./build-optimized.sh
# Or manually with cargo
cargo build --target wasm32-wasip1 --releaseThe REST Client includes a Language Server Protocol (LSP) server for enhanced editor features like auto-completion, hover hints, and diagnostics.
Quick Build (Current Platform):
# macOS/Linux
./build-lsp.sh
# Windows
.\build-lsp.ps1Cross-Platform Build:
# Build for all supported platforms
./build-lsp.sh --all
# Build for specific platform
./build-lsp.sh --target x86_64-apple-darwinManual Build:
# Build optimized release binary
cargo build --bin lsp-server --release
# Binary location:
# - macOS/Linux: target/release/lsp-server
# - Windows: target\release\lsp-server.exeSupported Platforms:
- macOS (Intel):
x86_64-apple-darwin - macOS (Apple Silicon):
aarch64-apple-darwin - Linux (x86_64):
x86_64-unknown-linux-gnu - Windows (x86_64):
x86_64-pc-windows-msvc
Binary Size: ~2.8MB (optimized with LTO and stripping)
For detailed build instructions, troubleshooting, and CI/CD integration, see BUILD.md.
cargo testThis project is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
- Inspired by VS Code REST Client
- Built for Zed editor
- Thanks to all contributors and the Zed community
Need help?
- 📖 Check the Documentation
- 🐛 Report bugs
- 💬 Ask questions
- 📝 Review Examples
Found a bug? Please include:
- Zed version
- Extension version
- Minimal
.httpfile that reproduces the issue - Error messages from logs
Happy API Testing! 🚀
Built with ❤️ for the Zed community