528件ヒット
[1-100件を表示]
(0.038秒)
種類
- インスタンスメソッド (432)
- クラス (36)
- 文書 (36)
- ライブラリ (12)
- モジュール (12)
クラス
-
Net
:: HTTP (180) -
Net
:: HTTPGenericRequest (24)
モジュール
-
Net
:: HTTPHeader (228)
キーワード
- HTTPNoContent (12)
- HTTPPartialContent (12)
- HTTPResetContent (12)
- OCSP (12)
- [] (12)
-
body
_ stream (12) -
body
_ stream= (12) -
content
_ length (12) -
content
_ length= (12) -
content
_ range (12) -
content
_ type (12) -
content
_ type= (12) - delete (12)
- fetch (36)
-
form
_ data= (12) - get2 (24)
-
get
_ fields (12) - head (12)
- head2 (24)
- key? (12)
-
main
_ type (12) - post (24)
- post2 (24)
-
range
_ length (12) -
request
_ get (24) -
request
_ head (24) -
request
_ post (24) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12) -
set
_ content _ type (12) -
set
_ form _ data (12) -
sub
_ type (12) -
type
_ params (12)
検索結果
先頭5件
-
net
/ http (38054.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...y]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'ur......{
require 'net/http'
url = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
}
puts res.body
//}
==== フォームの情報を送信する (POST)
//emlist[例][ruby]{
require 'net/http'
require '......かたです。
この方法は、1866 Hypertext Markup Language - 2.0 で初めて公式に登場し、
HTML 4.01 Specification の 17.13.4 Form content types
でもそのように書かれています。
ところが、同じ HTML 4.01 Specification の
B.2.2 Ampersands in URI attribute values... -
Net
:: HTTPHeader # content _ length=(len) (14147.0) -
Content-Length: ヘッダフィールドに値を設定します。
...Content-Length: ヘッダフィールドに値を設定します。
len に nil を与えると Content-Length: ヘッダフィールドを
削除します。
@param len 設定する値を整数で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/ind......ex.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10 # => 10
req.content_length # => 10
//}... -
Net
:: HTTPHeader # content _ type -> String|nil (14147.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/form-data'
req.content_type # => "multipart/form-data"
//}... -
Net
:: HTTPHeader # content _ type=(type) (14142.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 = {}) (14142.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 # content _ length -> Integer|nil (14141.0) -
Content-Length: ヘッダフィールドの表している値を整数で返します。
...Content-Length: ヘッダフィールドの表している値を整数で返します。
ヘッダが設定されていない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。......//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10
req.content_length # => 10
//}... -
Net
:: HTTPHeader # content _ range -> Range|nil (14141.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...
Content-Range: ヘッダフィールドの値を Range で返します。
Range の表わす長さは Net::HTTPHeader#range_length で得られます。
ヘッダが設定されていない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_range # => nil
req['Content-Range'] = "bytes 0-499/1234"
req.content_range # => 0..499
//}... -
Net
:: HTTPNoContent (14016.0) -
HTTP レスポンス 204 (No Content) を表現するクラスです。
...HTTP レスポンス 204 (No Content) を表現するクラスです。
詳しくは 7231 Section 6.3.5 を見てください。... -
Net
:: HTTPPartialContent (14016.0) -
HTTP レスポンス 206 (Partial Content) を表現するクラスです。
...HTTP レスポンス 206 (Partial Content) を表現するクラスです。
詳しくは 7233 Section 4.1 を見てください。...