Ruby 获取 HTTP 回应中的所有 Head 信息

2015-05-30 0 272
Ruby 获取 HTTP 回应中的所有 Head 信息
require 'uri'
Net::HTTP.get(URI.parse("http://www.oschina.net"))
response = Net::HTTP.get_response('www.oschina.net', '/code/list')


response.each_key { |key| puts key }
# x-cache
# p3p
# content-type
# date
# server
# transfer-encoding

遇见资源网 ruby Ruby 获取 HTTP 回应中的所有 Head 信息 http://www.ox520.com/16357.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务