Live data from Hacker News

Requestdiff – Send two HTTP requests and visualize any differences

requestdiff.com

21–30 of 36 posts

Re: Requestdiff – Send two HTTP requests and visualize any differences

#21
post #6

For command-line junkies: diff https://httpbin.org/get ) https://httpbin.org/get?show_env=1 )

Actually this is closer still to the output. Requires colordiff: diff -u https://httpbin.org/get ) 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.

Re: Requestdiff – Send two HTTP requests and visualize any differences

#22
Not working on Safari Version 8.0.6 (10600.6.3) Mac OS X 10.10.3

From JS Console:

[Error] TypeError: undefined is not a function (evaluating 'Array.from(e)') _toConsumableArray2 (app.min.js.pagespeed.ce.ozGaCBt6Kj.js, line 1) s (app.min.js.pagespeed.ce.ozGaCBt6Kj.js, line 1) f (app.min.js.pagespeed.ce.ozGaCBt6Kj.js, line 1) onload (app.min.js.pagespeed.ce.ozGaCBt6Kj.js, line 1)

Re: Requestdiff – Send two HTTP requests and visualize any differences

#23

Requests are made server side, which make this unusable for local/dev environnement purpose. Too bad !

Right. I was aiming to do it client-side only but I found out that web browsers restrict the headers you have access to through cross-origin XHR requests [1][2].

So it was a trade-off and I preferred showing all the headers at the expense of having to proxy the calls through a server.

[1] http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheade...

[2] http://www.w3.org/TR/cors/#cross-origin-request

I will make it available on Github later, so that you at least have the option of running it yourself.

Re: Requestdiff – Send two HTTP requests and visualize any differences

#25
post #8

Good work but frankly this would be useful if it was: (1) Terminal based (2) Supported other types of HTTP requests (3) Supported request body (4) Allowed editing request headers (5) Wasn't so easily exploitable to be used as a proxy or a DDoS relay (server-side bummer): http://requestdiff.com/proxy?url1=https://www.amazon.com&url...

You might want to take a look at Gavel https://github.com/apiaryio/gavel (and its JS implementation Gavel.js https://github.com/apiaryio/gavel.js)

(disclosure: I work for Apiary.io)

Re: Requestdiff – Send two HTTP requests and visualize any differences

#27

Requests are made server side, which make this unusable for local/dev environnement purpose. Too bad !

For dev or CI you might want to take a look at Gavel https://github.com/apiaryio/gavel (or even Dredd for that matter https://github.com/apiaryio/dredd)

(disclosure: I work for Apiary.io)

Re: Requestdiff – Send two HTTP requests and visualize any differences

#28
post #4

Earlier quoted context omitted.

Not yet, but I'm planning to open source it later today. I will reply here with the Github link. Glad that you found it useful!

Awesome, waiting for the Github repo!

Here it is! https://github.com/vdel26/requestdiff

Re: Requestdiff – Send two HTTP requests and visualize any differences

#29
post #9

This is very cool! Looking forward to it being open source (also, things from Barcelona rocks ;) ) For people wanting to have a CLI tool instead, John Graham-Cumming's httpdiff might be worth looking at. https://github.com/jgrahamc/httpdiff

Thanks a lot :)

Httpdiff is a really good tool and way more powerful than mine.

I've used it multiple times and wanted to try making something that focused more on the request body (which in Httpdiff are saved to temporary files) and that was also a bit more visual than a CLI.

Btw, here is the code! https://github.com/vdel26/requestdiff

Post reply on HN