るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dh p
  5. dh p=

検索結果

<< 1 2 3 ... > >>

Net::HTTP#close_on_empty_response -> bool (18310.0)

レスポンスがボディを持っていない場合にコネクションを 閉じるかどうかを返します。

...レスポンスがボディを持っていない場合にコネクションを
閉じるかどうかを返します。

デフォルトでは偽(閉じない)です。

@see Net::HTTP#close_on_empty_response=...

Net::HTTP#close_on_empty_response=(bool) (18310.0)

レスポンスがボディを持っていない場合にコネクションを 閉じるかどうかを設定します。

...ンスがボディを持っていない場合にコネクションを
閉じるかどうかを設定します。


@param bool レスポンスがボディを持っていない場合にコネクションを
閉じるかどうか指定します。

@see Net::HTTP#close_on_empty_response...

Net::HTTPExceptions#response -> Net::HTTPResponse (15403.0)

例外の原因となったレスポンスオブジェクトを返します。

...レスポンスオブジェクトを返します。

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

uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.response # => #<Net::HTTPNotFound 404 Not Found readbody=true>
end
//}...

Net::HTTPResponse#http_version -> String (15203.0)

サーバがサポートしている HTTP のバージョンを文字列で返します。

...サーバがサポートしている HTTP のバージョンを文字列で返します。

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

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//}...

Net::HTTP#options(path, initheader = nil) -> Net::HTTPResponse (12303.0)

サーバの path に OPTIONS リクエストを ヘッダが initheader として送り、 レスポンスを Net::HTTPResponse のオブジェクト で返します。

...サーバの path に OPTIONS リクエストを
ヘッダが initheader として送り、
レスポンスを Net::HTTPResponse のオブジェクト
で返します。

@param path リクエストを送るパスを文字列で与えます。
@param initheader リクエストのヘッダを「文...
...字列=>文字列」の
ハッシュで与えます。

@see Net::HTTP::Options...

絞り込み条件を変える

Net::HTTPHeader#content_type=(type) (12303.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 = {}) (12303.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#response_body_permitted? -> bool (12203.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#content_type -> String|nil (12203.0)

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

...のような 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.re...
...quest_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}...
<< 1 2 3 ... > >>