0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[ruby] Google API Clientでレスポンスを表示する

Posted at

レスポンス確認コード

require 'google/apis/core/base_service'

Google::Apis.logger = Logger.new($stdout)
Google::Apis.logger.level = Logger::DEBUG

標準出力にAPIのレスポンス(HTTP::Messageオブジェクト)が表示されます。

背景

Google API ClientライブラリでAPIを叩いていると、エラーが起こってもほとんどエラー情報を得ることができません。APIレスポンスを表示させることで、エラー修正に役立ちそうな情報(ステータスコードとか、リクエストURIとか)を集めることができます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?