Live data from Hacker News

Requestdiff – Send two HTTP requests and visualize any differences

requestdiff.com

1–10 of 36 posts

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

#2
Seems like a useful tool; thanks for sharing it!

Two questions:

1) What's the diff logic? At first glance, it looks like JSON is reformatted (maybe canonicalized in some way) and then a line-by-line diff is applied. Is there more to it? Since the tool seems JSON-aware, I was surprised to see an added trailing comma up as a difference.

2) Do you have plans to expand the kind of HTTP requests users can make? It would be nice to use different verbs, headers, and request bodies. Runscope has a similar tool[0] built in that I believe (haven't tried it yet) allows a bit more flexibility, but it would be nice to have a standalone tool available.

[0] http://blog.runscope.com/posts/comparing-http-requests-using...

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

#7
post #2

Seems like a useful tool; thanks for sharing it! Two questions: 1) What's the diff logic? At first glance, it looks like JSON is reformatted (maybe canonicalized in some way) and then a line-by-line diff is applied. Is there more to it? Since the tool seems JSON-aware, I was surprised to see an added trailing comma up as a difference. 2) Do you have plans to expand the kind of HTTP requests users can make? It would b…

Great questions:

1) the diff is really simple, line by line and text based. I'm just using this really awesome library to do it: https://github.com/kpdecker/jsdiff The JSON is just being pretty printed to be able to do a text diff in a meaningful way.

2) Yes, I do, and thanks for the suggestions! But I just wanted to go with the minimal version first and see if people found it useful.

I didn't know about Runscope's diffing feature. Btw, I'm using a HTTPBin for the sample requests, which is a Runscope project as far as I know :)

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

#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...

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

#10
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

Post reply on HN