Sends the given request req
to the server; forms the response into a Net::HTTPResponse
object.
The given req
must be an instance of a subclass of Net::HTTPRequest. Argument body
should be given only if needed for the request.
With no block given, returns the response object:
http = Net::HTTP.new(hostname) req = Net::HTTP::Get.new('/todos/1') http.request(req) # => #<Net::HTTPOK 200 OK readbody=true> req = Net::HTTP::Post.new('/todos') http.request(req, 'xyzzy') # => #<Net::HTTPCreated 201 Created readbody=true>
With a block given, calls the block with the response and returns the response:
req = Net::HTTP::Get.new('/todos/1') http.request(req) do |res| p res end # => #<Net::HTTPOK 200 OK readbody=true>
Output:
#<Net::HTTPOK 200 OK readbody=false>
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Return true if this spec should be ignored because it’s missing extensions.
Does this dependency require a prerelease?
What does this dependency require?
Cleans up uninstalled files and invalid gem specifications
Indicate if this NameTuple
is for a prerelease version.
Noop this out so there are no anchors
Performs a Gem::Net::HTTP request of type request_class
on uri
returning a Gem::Net::HTTP response object. request maintains a table of persistent connections to reduce connect overhead.
A requirement is a prerelease if any of the versions inside of it are prereleases
True if the version
string matches RubyGems’ requirements.
A version is considered a prerelease if it contains a letter.
Lists the external (to RubyGems) requirements that must be met for this gem to work. It’s simply information for the user.
Usage:
spec.requirements << 'libmagick, v6.0' spec.requirements << 'A good graphics card'
Set
requirements to req
, ensuring it is an array.
Used for debugging
Returns true
if this process is stopped, and if the corresponding wait call had the Process::WUNTRACED flag set, false
otherwise.