Skip to content

HTTP Client

The HTTP Client in DevKnife provides a complete solution for testing REST APIs and HTTP endpoints directly from your Mac. Write requests in a simple text format, execute them with a click or keyboard shortcut, and instantly see detailed responses. Everything works offline with no data ever leaving your computer.

DevKnife HTTP Client
  • Multiple HTTP methods – GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, and more
  • Variables and environments – define reusable variables and load them from .env files
  • Named requests – reference previous responses in new requests
  • Response caching – automatically cache responses from named requests
  • File operations – save and open .http request collections
  • Keyboard shortcuts – execute requests with Cmd+Enter
  • Layout switching – toggle between side-by-side and stacked views
  • Syntax highlighting – color-coded requests for better readability

When you first open the HTTP Client, a demo file loads automatically with examples showing how to write requests. The format is simple and intuitive:

### Simple GET Request
GET https://api.example.com/users
### POST with Headers and Body
POST https://api.example.com/users
Content-Type: application/json
Authorization: Bearer token123
{
"name": "John Doe",
"email": "[email protected]"
}

Each request starts with an HTTP method and URL, followed by optional headers and a request body. Requests are separated by ### comment lines.

There are multiple ways to execute a request:

  • Click the play button in the gutter next to any HTTP method
  • Press Cmd+Enter when your cursor is anywhere within a request block
  • The play button changes to a stop button while a request is running, allowing you to cancel it

Variables make your requests reusable and maintainable. Define them at the top of your file:

@baseUrl = https://api.example.com
@token = your-api-token-here
GET {{baseUrl}}/users
Authorization: Bearer {{token}}

Use @variableName = value to define a variable, and {{variableName}} to reference it anywhere in your requests.

Load variables from .env files to manage different environments (development, staging, production):

  1. Click the environment dropdown in the toolbar
  2. Select “Select Environment…”
  3. Choose your .env file

The environment file format is standard:

API_URL=https://api.staging.example.com
API_TOKEN=staging-token-123

Reference these in your requests as {{API_URL}} and {{API_TOKEN}}.

Give requests names to reference their responses later:

# @name getUser
GET https://api.example.com/users/1
### Use the response from the previous request
POST https://api.example.com/posts
Content-Type: application/json
{
"userId": "{{getUser.response.body.id}}",
"title": "New Post"
}

The # @name comment assigns a name to a request. Later requests can access the response using {{requestName.response.body.fieldName}} syntax.

A complete request includes:

  1. Method and URL (required)

    POST https://api.example.com/endpoint
  2. Headers (optional, one per line)

    Content-Type: application/json
    Authorization: Bearer token
  3. Body (optional, after a blank line)

    {
    "key": "value"
    }

The response panel shows:

  • Status code and message – e.g., “200 OK”
  • Response time – how long the request took
  • Response size – total bytes received
  • Headers – all response headers
  • Cookies – parsed Set-Cookie headers
  • Body – formatted response body with syntax highlighting

Save and organize your request collections:

  • New (Cmd+N) – start a fresh request file
  • Open (Cmd+O) – open an existing .http file
  • Save (Cmd+S) – save changes to the current file
  • Save As – save to a new location

The current file name appears in the title bar with a dot (•) indicator for unsaved changes.

Switch between viewing modes using the options menu (gear icon):

  • Side-by-Side – request editor and response panel next to each other
  • Stacked – request editor above response panel

Your preference is saved and restored when you reopen the app.

All standard HTTP methods are supported:

  • GET
  • POST
  • PUT
  • DELETE
  • PATCH
  • HEAD
  • OPTIONS
  • CONNECT
  • TRACE

The editor provides syntax highlighting for:

  • HTTP methods – bold and colored
  • Comments – lines starting with #
  • Separators – ### dividers between requests
  • Variable declarations – @variableName = value
  • Variable references – {{variableName}} in URLs, headers, and bodies
  • Headers – name:value pairs
  • Request names – # @name declarations

The HTTP Client runs entirely on your Mac. No requests are routed through external servers, and no data is collected or transmitted to third parties. Your API keys, tokens, and sensitive data remain completely private.

  • Use the demo file as a starting point – it includes examples of all major features
  • Save commonly used requests in .http files for quick access
  • Organize requests with ### separators and descriptive comments
  • Name your requests when you need to chain multiple API calls
  • Use environment files to switch between development and production endpoints
  • Press Cmd+Enter from anywhere in a request to execute it quickly