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

谁都会走 提交于 2019-12-18 08:57:27

问题


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:


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.



来源:https://stackoverflow.com/questions/13900195/how-do-i-debug-http-of-ruby-google-api-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!