MikeScott8 Programming Thoughts

My musings, ponderings, and other posts on programming. And maybe gadgets and other nerd stuff.


Leave a comment

JSON echo test service(s)

So recently I got an email from a friend asking for some help with making some JSON requests to a webservice. Of course since they were in development the service they were trying to hit wasn’t something I could hit from my computer. But that wasn’t really the issue I had as the issue my friend had was with the client not even sending the request.

I was playing with the code they sent in a JS Fiddle (jsfiddle.net) and tried using the JSON echo service js fiddle provides. I got the data to get sent to the service, but couldn’t seem to get a response from it. So whats a lazy developer to do? “google it with bing” and my searching wasn’t productive. I found plenty of JSON test CLIENTS but not any services that would do a simple echo back of the data sent to it.

Of course being a programmer, I whipped up a quick and dirty simple service that did that and moved the JavaScript code from my JSFiddle into a test page in the local test site with the service. I then got it working to a point enough I sent the sample I built back to my friend.

THEN…being disappointed with my “google-fu”, I tried some more searches. And of course after I had rolled my own THEN I found some links that would have worked for me. Actually I found a blog post by Brian Cantoni that covered the same/similar issues he was having. And from that blog post he mentioned two services (both provided FREE by RunScope).

I am listing them here for future reference (for me, and maybe if someone else finds this post)

  • http://respondto.it/ – which they(RunScope) designed to use to inspect what data you would get sent back by webhooks (callback requests from another service), before pointing the other service to your real application.
    • You create a unique url for your endpoint
    • then setup JSON or XML data for the response the test service should respond with when it gets hit
    • then you take that endpoint url and enter it into the other service
    • test send to the service and when it sends a request post-processing to you
    • go to the resondto.it site and see what was sent to the endpoint
  • http://requestb.in/– which is almost identical to the first one in the list.
    • the biggest difference is not being able to set what response is sent for the endpoint
    • another is not being able to choose the url. You get a random one.

So I hope this helps someone, or me, in the future.


Leave a comment

Things about JSON.stringify() I didn’t know

So today I was reviewing a weekly JavaScript email I get, and found an article that piqued my interest. I went to the article and found some things I didn’t know about JSON.stringify()

I have been using JS libraries for my work and really never used JSON.stringify() function directly very often. The times I did use it, the calls were fairly plain vanilla calls, passing an JavaScript object to it and getting back the string.

But this article (link at end of post) by Jim Cowart covered some things I didn’t know, and like Jim, I felt these should be passed along to others. I really liked the ideas of white and black listing members of objects for logging parts of objects while debugging/profiling client side code.

Hope someone else learns something new from this too.

Jim Cowart’s “What You Might Not Know About JSON.stringify()”