如何调试 Ruby google-api-client 的 HTTP [英] How do I debug HTTP of Ruby google-api-client

查看:16
本文介绍了如何调试 Ruby google-api-client 的 HTTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 google-api-client 与 Google Drive 集成.由于发生了很多事情,我希望能够看到网络上发生的事情(http 级别).客户端似乎使用法拉第进行 http 连接.如何从 Faraday 中获取有线转储进行调试?

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?

推荐答案

Google api 客户端默认使用 Faraday.default_connection.因此可以操作该对象,只需使用以下代码行即可:

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.

这篇关于如何调试 Ruby google-api-client 的 HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆