So I have an app that uses the Zend amazon web services client. I am now getting an error from the service, and I want to see the raw request and response.
I can’t find a way to do this in the docs! This class implements Zend_Rest_Client so it seems like there should be a rawResponse() method but there isn’t. This is on a production server and I am behind a firewall, so I can’t proxy to fiddler.
Any suggestions?
Zend_Rest_ClientextendsZend_Service_Abstract, which in turn implements agetHttpClient()method, which returns aZend_Http_Clientinstance, which exposes agetLastResponse()method, which returns aZend_Http_Responseinstance, which once again exposes agetBody()method. Phew, that’s OOP I guess :).Let’s talk our language though:
That’s it.
EDIT:
It appears that
Zend_Service_Abstract::getHttpClient()is static, so you can even call it like this:But I wouldn’t recommend it. You have to know exactly when to call the method, as the HTTP client must be populated with some response. Not to mention that static methods are just some kind of globals, which is bad.