Compare HTTP responses from two servers and visualize the differences. Ideal for testing API migrations, load balancer configurations, and server deployments.
khttpdiff performs identical HTTP requests against two different servers and presents a detailed comparison of their responses. The tool presents differences in status codes, headers, and response bodies with color-coded output. For optimal visualization, use a terminal that supports ANSI escape sequences.
Configure requests with custom methods, headers, and request bodies. Output differences are color-coded for easy identification, or use monochrome mode for unsupported terminals. Integrate external diff tools for detailed body comparison. The tool supports both secure and insecure SSL connections.
Download the khttpdiff.zip folder containing the khttpdiff.exe executable. No Java installation required.
- Copy the khttpdiff folder to a permanent location (e.g.,
C:\Program Files\khttpdiff) - Open System Properties (
Win + Pause/Breakorright-clickThis PC > Properties) - Click
Advanced system settings - Click
Environment Variables - Under
System variables, find and selectPath, then clickEdit - Click
Newand add the full path to thekhttpdifffolder - Click
OKto save changes - Restart your terminal
khttpdiff [options] url1 url2
method <method> : HTTP method to use (default: GET)
body <data> : Request body for POST/PUT requests
host <host> : Custom Host header value
agent <ua> : User-Agent string (default: khttpdiff/0.1)
ignore <headers> : Comma-separated list of headers to exclude from comparison
header <hdr> : Single custom header in "Key: Value" format
headers <file> : File containing custom headers (one per line)
insecure : Allow insecure SSL connections (skip certificate validation)
diffapp <app> : External diff tool for body comparison
mono : Disable color output
help : Display help information
khttpdiff https://httpbin.org/get https://httpbin.org/uuid
khttpdiff -method POST -body '{"name":"test"}' -header "Content-Type: application/json" https://httpbin.org/post https://postman-echo.com/post
khttpdiff -ignore Date,Server https://jsonplaceholder.typicode.com/posts/1 https://jsonplaceholder.typicode.com/posts/2
khttpdiff -diffapp fc https://dummyjson.com/products/1 https://dummyjson.com/products/2
Create a headers.txt file:
Authorization: Bearer token123
Content-Type: application/json
X-Custom-Header: value
Then run:
khttpdiff -headers headers.txt -method POST -body '{"test":true}' https://httpbin.org/post https://postman-echo.com/post
khttpdiff -insecure https://self-signed.badssl.com https://httpbin.org/get
Headers files should contain one header per line in "Key: Value" format. Lines starting with "//" are treated as comments and ignored. Empty lines are also ignored.
Example:
// Authentication headers
Authorization: Bearer token123
// Content headers
Content-Type: application/json
Accept: application/json
Contributions are welcome. Please read the CONTRIBUTING.md file for guidelines on how to submit issues, feature requests, and pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
Inspired by httpdiff by John Graham-Cumming.
