るりまサーチ

最速Rubyリファレンスマニュアル検索!
492件ヒット [101-200件を表示] (0.051秒)

別のキーワード

  1. httpheader fetch
  2. httpheader set_range
  3. httpheader range=
  4. httpheader []
  5. httpheader []=

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Net::HTTPHeader#basic_auth(account, password) -> [String] (3002.0)

Authorization: ヘッダを BASIC 認証用にセットします。

Authorization: ヘッダを BASIC 認証用にセットします。

@param account アカウント名を文字列で与えます。
@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.basic_auth("user", "pass") # => ["Basic dXNlcjpwYXNz"]
//}...

Net::HTTPHeader#canonical_each {|name, value| .... } -> () (3002.0)

ヘッダフィールドの正規化名とその値のペアを ブロックに渡し、呼びだします。

ヘッダフィールドの正規化名とその値のペアを
ブロックに渡し、呼びだします。

正規化名は name に対し
name.downcase.split(/-/).capitalize.join('-')
で求まる文字列です。

Net::HTTPHeader#chunked? -> bool (3002.0)

Transfer-Encoding: ヘッダフィールドが "chunked" である 場合に真を返します。

Transfer-Encoding: ヘッダフィールドが "chunked" である
場合に真を返します。

Transfer-Encoding: ヘッダフィールドが存在しなかったり、
"chunked" 以外である場合には偽を返します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.chunked? # => false
req["Transfer-Encodin...

Net::HTTPHeader#content_length -> Integer|nil (3002.0)

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

...ィールドの表している値を整数で返します。

ヘッダが設定されていない場合には nil を返します。

@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。

//emlist[例][ruby]{
require...

Net::HTTPHeader#content_length=(len) (3002.0)

Content-Length: ヘッダフィールドに値を設定します。

Content-Length: ヘッダフィールドに値を設定します。

len に nil を与えると Content-Length: ヘッダフィールドを
削除します。

@param len 設定する値を整数で与えます。

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

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

絞り込み条件を変える

Net::HTTPHeader#content_type -> String|nil (3002.0)

"text/html" のような Content-Type を表す 文字列を返します。

"text/html" のような Content-Type を表す
文字列を返します。

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

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

uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/for...

Net::HTTPHeader#content_type=(type) (3002.0)

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

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

@param 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 # => ni...

Net::HTTPHeader#delete(key) -> [String] | nil (3002.0)

key ヘッダフィールドを削除します。

key ヘッダフィールドを削除します。

@param key 削除するフィールド名
@return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length...

Net::HTTPHeader#each {|name, val| .... } -> () (3002.0)

保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。

保持しているヘッダ名とその値をそれぞれ
ブロックに渡して呼びだします。

ヘッダ名は小文字で統一されます。
val は ", " で連結した文字列がブロックに渡されます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }

# => accept-encoding...
<< < 1 2 3 4 ... > >>