Method: Gem::Net::HTTPGenericRequest#body

Defined in:
lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb

#bodyObject

Returns the string body for the request, or nil if there is none:

req = Gem::Net::HTTP::Post.new(uri)
req.body # => nil
req.body = '{"title": "foo","body": "bar","userId": 1}'
req.body # => "{\"title\": \"foo\",\"body\": \"bar\",\"userId\": 1}"


145
146
147
# File 'lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb', line 145

def body
  @body
end