|
|
|
|
|
by smarx
3889 days ago
|
|
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... |
|
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 :)