Method: Net::HTTPGenericRequest#body
- Defined in:
- lib/net/http/generic_request.rb
#body ⇒ Object
Returns the string body for the request, or nil
if there is none:
req = 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/net/http/generic_request.rb', line 145 def body @body end |