るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. rexml/document node_type
  2. win32ole ole_type
  3. rss type
  4. rss type=
  5. net/imap media_type

検索結果

Net::HTTP#head(path, header = nil) -> Net::HTTPResponse (54661.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。

サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse のインスタンスを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。

1.1 互換モードの場合は、レスポンスに応じて例外が発生します。

//em...

Net::HTTPHeader#content_type=(type) (27784.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#set_content_type(type, params = {}) (27784.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#content_type -> String|nil (27427.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#type_params -> Hash (27391.0)

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

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::HTTPHeader#main_type -> String|nil (27343.0)

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

"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#sub_type -> String|nil (27343.0)

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

"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"
//}

Gem::Package::TarHeader#typeflag -> String (27304.0)

tar のヘッダに含まれる typeflag を返します。

tar のヘッダに含まれる typeflag を返します。

Kernel#have_type(type, headers = nil, opt = "") -> bool (19072.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_type" を追加し、真を返します。型 type がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_type('foo') # => true

である場合、HAVE_TYPE_FOO をというプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt ...

Kernel#have_type(type, headers = nil, opt = "") { ... } -> bool (19072.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DHAVE_type" を追加し、真を返します。型 type がシステムに存在しない場
合は、偽を返します。

例えば、

require 'mkmf'
have_type('foo') # => true

である場合、HAVE_TYPE_FOO をというプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt ...

絞り込み条件を変える

Kernel#find_type(type, opt, *headers) -> Array (19000.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

@param type 検査したい型の名前を指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

@param headers 追加のヘッダを指定します。

@see Kernel#have_type

Kernel#find_type(type, opt, *headers) { ... } -> Array (19000.0)

静的な型 type がシステムに存在するかどうか検査します。

静的な型 type がシステムに存在するかどうか検査します。

@param type 検査したい型の名前を指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

@param headers 追加のヘッダを指定します。

@see Kernel#have_type

Kernel#try_type(type, headers = nil, opt = "") -> bool (18982.0)

Kernel#have_type を使ってください。

Kernel#have_type を使ってください。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

Kernel#try_type(type, headers = nil, opt = "") { ... } -> bool (18982.0)

Kernel#have_type を使ってください。

Kernel#have_type を使ってください。

@param type 検査したい型の名前を指定します。

@param headers 追加のヘッダを指定します。

@param opt コンパイラに渡す追加のオプションを指定します。

Net::HTTP#head2(path, header = nil) -> Net::HTTPResponse (18688.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。

@param path ヘ...

絞り込み条件を変える

Net::HTTP#head2(path, header = nil) {|response| .... } -> Net::HTTPResponse (18688.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。

@param path ヘ...

Net::HTTP#request_head(path, header = nil) -> Net::HTTPResponse (18688.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。

@param path ヘ...

Net::HTTP#request_head(path, header = nil) {|response| .... } -> Net::HTTPResponse (18688.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。

@param path ヘ...

CGI#header(options = "text/html") -> String (18466.0)

HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。

HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。
CGI#out を使わずに自力で HTML を出力したい場合などに使います。
このメソッドは文字列エンコーディングを変換しません。

ヘッダのキーとしては以下が利用可能です。

: type
Content-Type ヘッダです。デフォルトは "text/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、
Date ヘッ...

Net::HTTPHeader#form_data=(params) (9022.0)

HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。

HTMLのフォームのデータ params から
ヘッダフィールドとボディを設定します。

ヘッダフィールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。

@param params HTML のフォームデータの Hash を与えます。
@param sep データのセパレータを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Ne...

絞り込み条件を変える

Net::HTTPHeader#key?(key) -> bool (9022.0)

key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。

key というヘッダフィールドがあれば真を返します。
key は大文字小文字を区別しません。

@param key 探すヘッダフィールド名を文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.key?('content-type') # => true
res.key?('nonexist-header') # => false
//}

Net::HTTPHeader#set_form_data(params, sep = '&') -> () (9022.0)

HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。

HTMLのフォームのデータ params から
ヘッダフィールドとボディを設定します。

ヘッダフィールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。

@param params HTML のフォームデータの Hash を与えます。
@param sep データのセパレータを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Ne...

Kernel#convertible_int(type, headers = nil, opts = nil) (1234.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (1234.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

If the +type+ is a integer type and _convertible_ type is found,
following macros are p...

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (994.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS...

絞り込み条件を変える

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (994.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS...

Kernel#have_struct_member(type, member, headers = nil) -> bool (730.0)

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在する場合は、
グローバル変数 $defs に "-DHAVE_type_member" を追加し、真を返します。
member というメンバを持つ構造体 type が存在しない場合は、偽を返します。

例えば

require 'mkmf'
have_struct_member('struct foo', 'bar') # => true

である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパ...

Kernel#have_struct_member(type, member, headers = nil) { ... } -> bool (730.0)

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。

member というメンバを持つ構造体 type がシステムに存在する場合は、
グローバル変数 $defs に "-DHAVE_type_member" を追加し、真を返します。
member というメンバを持つ構造体 type が存在しない場合は、偽を返します。

例えば

require 'mkmf'
have_struct_member('struct foo', 'bar') # => true

である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパ...

Kernel#check_sizeof(type, headers = nil) -> Integer | nil (682.0)

与えられた型のサイズを返します。

与えられた型のサイズを返します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。

例えば、

require 'mkmf'
check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型を指定します。

@param headers 追加のヘッダファイルを指定します。

Kernel#check_sizeof(type, headers = nil) { ... } -> Integer | nil (682.0)

与えられた型のサイズを返します。

与えられた型のサイズを返します。

型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。

例えば、

require 'mkmf'
check_sizeof('mystruct') # => 12

である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。

@param type 検査したい型を指定します。

@param headers 追加のヘッダファイルを指定します。

絞り込み条件を変える

Net::HTTP#post2(path, data, header = nil) -> Net::HTTPResponse (358.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。

POST する場合にはヘッ...

Net::HTTP#post2(path, data, header = nil) {|response| .... } -> Net::HTTPResponse (358.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。

POST する場合にはヘッ...

Net::HTTP#request_post(path, data, header = nil) -> Net::HTTPResponse (358.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。

POST する場合にはヘッ...

Net::HTTP#request_post(path, data, header = nil) {|response| .... } -> Net::HTTPResponse (358.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。

POST する場合にはヘッ...

Net::HTTP#get2(path, header = nil) -> Net::HTTPResponse (340.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取...

絞り込み条件を変える

Net::HTTP#get2(path, header = nil) {|response| .... } -> Net::HTTPResponse (340.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取...

Net::HTTP#post(path, data, header = nil, dest = nil) -> Net::HTTPResponse (340.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。

返り値は Net::HTTPResponse のインスタンスです。

ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。

POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を...

Net::HTTP#post(path, data, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (340.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。

返り値は Net::HTTPResponse のインスタンスです。

ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。

POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を...

Net::HTTP#request_get(path, header = nil) -> Net::HTTPResponse (340.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取...

Net::HTTP#request_get(path, header = nil) {|response| .... } -> Net::HTTPResponse (340.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取...

絞り込み条件を変える

WEBrick::HTTPUtils::FormData#[](header) -> String | nil (322.0)

自身が multipart/form-data なデータの場合に、header で指定された ヘッダの値を文字列で返します。無ければ nil を返します。

自身が multipart/form-data なデータの場合に、header で指定された
ヘッダの値を文字列で返します。無ければ nil を返します。

@param header ヘッダ名を文字列で指定します。大文字と小文字を区別しません。

例:

require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q']['content-type'] #=> "plain/text"
end
end
MyCGI.new.start()

CGI#out(options = "text/html") { .... } (112.0)

HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。

HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。

HEADリクエスト (REQUEST_METHOD == "HEAD") の場合は HTTP ヘッダのみを出力します。

charset が "iso-2022-jp"・"euc-jp"・"shift_jis" のいずれかで
ある場合は文字列エンコーディングを自動変換し、language を "ja"にします。

@param options Hash か文字列で HTTP ヘッダを生成するための情報を指定します。

例:
cgi = CGI.new
cgi.out{ "string" ...