13

I would like to capture the full request (raw_request -- what went over the wire) for a given action without using a proxy.

I am aware of the debug_output method on the Class, and that might be part of the solution. But unclear on how to set it on a per request basis.

Consider the following ...

@response = HTTParty.post(@job.callback_url, body: @job.to_json)
notification = Notification.new
notification.response_body = @response.body
notification.response_code = @response.code
notification.request_body = ????

Thanks!

Jonathan

4

3 に答える 3

18

@response.requestrequest オブジェクトが含まれます。

于 2011-08-02T19:06:02.593 に答える
9

include HTTParty行の下に次を追加します。

debug_output $stdout

これにより、デバッグ用の出力ストリームが設定され、出力ストリームは Net::HTTP#set_debug_output に渡されます。

于 2011-09-03T11:44:15.217 に答える