るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Psych::Parser::Mark#index -> Integer (24102.0)

先頭からの文字数。

先頭からの文字数。

CSV::FieldInfo#index -> Integer (18126.0)

行内で何番目のフィールドかわかるゼロベースのインデックスを返します。

...例][ruby]{
require 'csv'

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p
field_info.index
Date.parse(field)
end
p
csv.first

# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-...

Net::HTTPHeader#content_type=(type) (6213.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 # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#set_content_type(type, params = {}) (6213.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 # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

Net::HTTPGenericRequest#path -> String (6119.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

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

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

絞り込み条件を変える

Net::HTTPGenericRequest#request_body_permitted? -> bool (6113.0)

リクエストにエンティティボディを一緒に送ることが許されている HTTP メソッド (POST など)の場合真を返します。

...許されている
HTTP メソッド (POST など)の場合真を返します。

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

uri = URI.parse('http://www.example.com/index.html')
p
ost = Net::HTTP::Post.new(uri.request_uri)
p
ost.request_body_permitted? # => true

head = Net::HTTP::Head.new(uri.request...
..._uri)
head.request_body_permitted? # => false
//}...

Net::HTTPGenericRequest#response_body_permitted? -> bool (6113.0)

サーバからのレスポンスにエンティティボディを含むことが許されている HTTP メソッド (GET, POST など)の場合真を返します。

...TP メソッド (GET, POST など)の場合真を返します。

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

uri = URI.parse('http://www.example.com/index.html')
p
ost = Net::HTTP::Post.new(uri.request_uri)
p
ost.response_body_permitted? # => true

head = Net::HTTP::Head.new(uri.request_uri)
head.resp...
...onse_body_permitted? # => false
//}...

Net::HTTPHeader#each_capitalized_name {|name| .... } -> () (6113.0)

保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。

...er' -> 'X-My-Header')
して、ブロックに渡します。

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

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

# => Accept-Encoding
# => Accept
# => User-Agent
//}...

Net::HTTPHeader#main_type -> String|nil (6113.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"
//}...
<< 1 2 3 ... > >>