Hacker News new | ask | show | jobs
by jalfresi 3894 days ago
For command-line junkies:

diff <(curl -sS -L https://httpbin.org/get) <(curl -sS -L https://httpbin.org/get?show_env=1)

2 comments

Actually this is closer still to the output. Requires colordiff:

diff -u <(curl -sS -D - -L https://httpbin.org/get) <(curl -sS -D - -L https://httpbin.org/get?show_env=1) | colordiff

You can replace colordiff with vim's less tool (/usr/share/vim/vim74/macros/less.sh ) or vimpager (https://github.com/rkitover/vimpager).

icdiff is also nice to have a side-by-side colored diff (https://github.com/jeffkaufman/icdiff). And of course, you could use meld, vimdiff, kompare etc. with the same bash anonymous pipes indirection.

you can leave off the pipe: colordiff -u <(curl -sS -D - -L https://httpbin.org/get) <(curl -sS -D - -L https://httpbin.org/get?show_env=1)
The website does show differences in the HTTP headers though.
As does this solution.