Parse JSON Object with Jenkins

Jenkins itself is not able to parse JSON response body. However, we can use Python with the built-in json library to parse JSON object within command-line. For example, if we request the URL like http://md5.jsontest.com/?text=example_text , this will return the values as 1 2 3 4 { md5: "fa4c6baa0812e5b5c80ed8885e55a8a6", original: "example_text" } With the help of Python json library, we can do something like 1 2 3 Url=http://md5.jsontest.com/?text=example_text Md5Info=`curl $Url -k | python -c "import sys, json; print json....

May 5, 2016 · 1 min · 100 words · Eric