class Gem::Net::HTTP::Get
Class for representing HTTP method GET:
require 'rubygems/net-http/lib/net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Gem::Net::HTTP::Get.new(uri) # => #<Gem::Net::HTTP::Get GET> res = Gem::Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Properties:
-
Request body: optional.
-
Response body: yes.
-
Safe: yes.
-
Idempotent: yes.
-
Cacheable: yes.
Related:
-
Gem::Net::HTTP.get
: sendsGET
request, returns response body. -
Gem::Net::HTTP#get
: sendsGET
request, returns response object.
Constants
- METHOD
- REQUEST_HAS_BODY
- RESPONSE_HAS_BODY