I use Koala in an application that interacts with Facebook through API calls. I want to record the raw HTTP requests that Koala generates as well as the responses Facebook sends back in a database. How can I grab these strings so that I can save them?
Share
This is an old question, but I couldn’t find a straight-forward example of how to debug Koala requests myself.
Koala uses Faraday, which is extremely extensible. It’s based on Rack middleware, for which Koala sets up default middleware. Here’s how to add logging to
STDOUTto the Faraday middleware:Koala documentation about HTTP requests:
https://github.com/arsduo/koala/wiki/HTTP-Services
You can read more about how to use Faraday and where I got the logger from right here:
https://mislav.net/2011/07/faraday-advanced-http/
Hopefully this helps anyone else looking for a simple way to debug Koala HTTP requests to the Facebook Graph API!