るりまサーチ

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

別のキーワード

  1. net/http body
  2. httprequest body
  3. httpresponse body
  4. net/http read_body
  5. webrick/httprequest body

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

CGI#print(*strings) (18126.0)

@todo

...@todo

引数の文字列を標準出力に出力します。
cgi.print は $DEFAULT_OUTPUT.print と等価です。

例:
cgi = CGI.new
cgi.print "This line is a part of content body.\r\n"...

WEBrick::HTTPResponse#body=(val) (6120.0)

クライアントに返す内容(エンティティボディ)をセットします。

...クライアントに返す内容(エンティティボディ)をセットします。

自身が chunked であっても body の値はチャンク形式ではありません。

@param val メッセージボディを文字列か IO オブジェクトで指定します。
自身が chun...
...エンコーディングされます。

require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
print
res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 08:58:49 GMT
Server:
Content-Length: 4...

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

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

...my_header1" => "my_value",
"my_header2" => "my_value"})

例:
cgi = CGI.new('html3')
print
cgi.header({"charset" => "shift_jis", "status" => "OK"})
print
"<html><head><title>TITLE</title></head>\r\n"
print
"<body>BODY</body></html>\r\n"

@see 35911...

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

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

...et('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print
str
end
}
//}

get2 は時代遅れなので使わない...
...でください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

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

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

...et('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print
str
end
}
//}

get2 は時代遅れなので使わない...
...でください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

絞り込み条件を変える

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

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

...nse.body # body is already read

# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body do |str| # read body now
print
str
end
}
//}

@see Net::HTTP#post, Net::HTTPResponse#read_body...

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

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

...nse.body # body is already read

# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body do |str| # read body now
print
str
end
}
//}

@see Net::HTTP#post, Net::HTTPResponse#read_body...

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

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

...et('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print
str
end
}
//}

get2 は時代遅れなので使わない...
...でください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

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

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

...et('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print
str
end
}
//}

get2 は時代遅れなので使わない...
...でください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...
<< 1 2 > >>