Sample code to consume rest webservices using streams, cURL, guzzle