How do I debug HTTP of Ruby google-api-client

2019-01-28 07:37发布

I'm trying to integrate with Google Drive, using the google-api-client. Since there's a lot of stuff going on, I would like to be able to see what's going over the wire (http level). It seems that the client uses Faraday for http connectivity. How would I get a wiredump out of Faraday for debugging?

1条回答
做自己的国王
2楼-- · 2019-01-28 07:52

Google api client uses Faraday.default_connection by default. It is thus possible to manipulate this object, which can be done simply with the following line of code:

Faraday.default_connection.response :logger

Took me a while to figure out.

查看更多
登录 后发表回答