curlWrapperTest::getMatchingJson

Protect against faulty redirects from server and find out if response is json.