我Net::HTTP
用来发出 POST 请求:
uri = 'service.example.com'
https = Net::HTTP.new(uri)
https.use_ssl = true
path = "/service_action"
data = request_body_obj.to_json
response = https.post(path, data, {'Content-Type' => 'application/json'})
我的请求由于某种原因超时。为了调试原因,我想查看请求正文的文本和请求的标头。有没有办法做到这一点?