るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.098秒)
トップページ > バージョン:2.4.0[x] > クエリ:p[x] > クエリ:on[x] > クエリ:tr[x] > モジュール:OpenURI::Meta[x]

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. rsa p
  5. dsa p=

ライブラリ

キーワード

検索結果

OpenURI::Meta#content_type -> String (45922.0)

対象となるリソースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。 Content-Type ヘッダがない場合は、"application/octet-stream" を返します。

対象となるリソースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。

//emlist[例][ruby]{
require 'open-uri'
open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/html"
}
//}

OpenURI::Meta#content_encoding -> [String] (27622.0)

対象となるリソースの Content-Encoding を文字列の配列として返します。 Content-Encoding ヘッダがない場合は、空の配列を返します。

対象となるリソースの Content-Encoding を文字列の配列として返します。
Content-Encoding ヘッダがない場合は、空の配列を返します。

例:

//emlist[例][ruby]{
require 'open-uri'
open('http://example.com/f.tar.gz') {|f|
p f.content_encoding #=> ["x-gzip"]
}
//}