るりまサーチ

最速Rubyリファレンスマニュアル検索!
720件ヒット [501-600件を表示] (0.020秒)

別のキーワード

  1. uri build
  2. uri extract
  3. uri new
  4. open-uri open
  5. uri regexp

検索結果

<< < ... 4 5 6 7 8 > >>

Net::HTTPHeader#main_type -> String|nil (6.0)

"text/html" における "text" のようなタイプを表す 文字列を返します。

...タイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//}...

Net::HTTPHeader#method -> String (6.0)

リクエストの HTTP メソッドを文字列で返します。

...リクエストの HTTP メソッドを文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//}...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (6.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

...ウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.proxy_basic_auth("account", "password") # => ["Basic Y...

Net::HTTPHeader#range_length -> Integer|nil (6.0)

Content-Range: ヘッダフィールドの表している長さを整数で返します。

...である場合に
発生します。


//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['Content-Range'] = "bytes 1-500/1000"
req.range_leng...

Net::HTTPHeader#set_content_type(type, params = {}) (6.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...を文字列で指定します。
@param params パラメータ属性をハッシュで指定します。

//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.co...

絞り込み条件を変える

Net::HTTPHeader#sub_type -> String|nil (6.0)

"text/html" における "html" のようなサブタイプを表す 文字列を返します。

...タイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.sub_type # => "html"
//}...

Net::HTTPHeader#type_params -> Hash (6.0)

Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。

...返します。

Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。

//emlist[例][ruby]{
require 'net/http'

uri =
URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.type_params # => {"charset"=>"UTF-8"}
//}...

Net::HTTPResponse#body -> String | () | nil (6.0)

エンティティボディを返します。

...dapter のインスタンスを返しますが、
これは使わないでください。

entity は obsolete です。

//emlist[例][ruby]{
require 'net/http'

uri =
"http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}...

Net::HTTPResponse#code -> String (6.0)

HTTP のリザルトコードです。例えば '302' などです。

...スオブジェクトがどのクラスのインスタンスかを
見ることでもレスポンスの種類を判別できます。

//emlist[例][ruby]{
require 'net/http'

uri =
"http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.code # => "200"
//}...
<< < ... 4 5 6 7 8 > >>