別のキーワード
ライブラリ
-
net
/ http (228)
キーワード
- get (24)
- get2 (24)
- head (12)
- head2 (24)
-
local
_ port= (12) - post (24)
- post2 (24)
-
request
_ get (24) -
request
_ head (24) -
request
_ post (24) -
send
_ request (12)
検索結果
先頭5件
- Net
:: HTTP # local _ port=(port) - Net
:: HTTP # send _ request(name , path , data = nil , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # request _ get(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # request _ head(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # request _ post(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse
-
Net
:: HTTP # local _ port=(port) (6208.0) -
接続に用いるローカルポートを設定します。
...@param port ローカルポート(数値、もしくはサービス名文字列)
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_port=, N......et::HTTP#local_host
@see Net::HTTP.new... -
Net
:: HTTP # send _ request(name , path , data = nil , header = nil) -> Net :: HTTPResponse (6208.0) -
HTTP リクエストをサーバに送り、そのレスポンスを Net::HTTPResponse のインスタンスとして返します。
...を
Net::HTTPResponse のインスタンスとして返します。
@param name リクエストのメソッド名を文字列で与えます。
@param path リクエストのパスを文字列で与えます。
@param data リクエストのボディを文字列で与えます。
@param header リ......クエストのヘッダをハッシュで与えます。
//emlist[例][ruby]{
response = http.send_request('GET', '/index.html')
puts response.body
//}
@see Net::HTTP#request... -
Net
:: HTTP # request _ get(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (3308.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ......接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取りだしたい場合にはこれを利用します。
@param path 取得するエンティテ......aram header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p re... -
Net
:: HTTP # request _ head(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (3308.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...エンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ......ックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。
@param path ヘッダを取得するエンティテ......文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
Net
:: HTTP # request _ post(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse (3308.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ...... Net::HTTPResponse
オブジェクトをブロックに渡します。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
@param p......。
@param data POSTするデータを与えます。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
post2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response... -
Net
:: HTTP # request _ get(path , header = nil) -> Net :: HTTPResponse (3208.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ......接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取りだしたい場合にはこれを利用します。
@param path 取得するエンティテ......aram header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p re... -
Net
:: HTTP # request _ head(path , header = nil) -> Net :: HTTPResponse (3208.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...エンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ......ックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。
@param path ヘッダを取得するエンティテ......文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
Net
:: HTTP # request _ post(path , data , header = nil) -> Net :: HTTPResponse (3208.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ...... Net::HTTPResponse
オブジェクトをブロックに渡します。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
@param p......。
@param data POSTするデータを与えます。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
post2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (126.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な......POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
dest は時代遅れの引数です。利用しないでください。
dest......取得して順次
「dest << ボディの断片」を実行します。
@param path POST先のパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの場合は...