Testing a JSON API with Curl

I’ve been working a lot on JSON APIs during the past few years, and even more intensively lately. If testing GET requests is straightforward, for POST requests I often had to look at Curl documentation again for exact options names and parameter syntax for sending the desired HTTP headers. So I decided to post some quick notes on doing unauthenticated POST requests, in order to have a quickly accessible reference....

September 27, 2014 · 1 min

Visualizing progression of file operations using pv (Pipe Viewer)

Compressing large files from command line can be time consuming, and unless using a file manager like Midnight Commander, there is usually no way to know in advance how long the operation is going to last. Enter pv (Pipe Viewer), a neat CLI tool allowing to monitor the progress of data through a pipeline, by displaying a progress bar and indicating both processing speed and estimated time until completion. Here are a few examples showing how to use the tool:...

March 31, 2014 · 2 min

Parsing JSON from command line using Python

With JSON becoming ubiquitous as an API response format, it is sometimes desirable to parse JSON data from command line. There are multiple tools available in order to do so, and I’m personally using jq, a lightweight and flexible command-line JSON processor. While jq is a fantastic tool, it introduces a dependency and might not be available in all environments. Python, on the other end, comes preinstalled on most Linux distributions and supports JSON out of the box since version 2....

February 4, 2014 · 1 min