我正在使用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'})
由于某种原因,我的请求暂停了。为了调试原因,我想查看请求正文和请求的标题。有没有办法做到这一点?