Skip to content

Commit e3c9011

Browse files
Update lib/net/http/request.rb
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
1 parent 4444e8c commit e3c9011

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/net/http/request.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@
5454
#
5555
# A POST request may be sent using request class \Net::HTTP::Post:
5656
#
57-
# json = {title: 'foo', body: 'bar', userId: 1}
58-
# # => "{\"title\":\"foo\",\"body\":\"bar\",\"userId\":1}"
5957
# _uri = uri.dup
6058
# _uri.path = '/posts'
6159
# req = Net::HTTP::Post.new(_uri) # => #<Net::HTTP::Post POST>
62-
# req.body = json
60+
# req.body = '{"title": "foo", "body": "bar", "userId": 1}'
6361
# req['Content-type'] = 'application/json; charset=UTF-8'
6462
# Net::HTTP.start(hostname) do |http|
6563
# http.request(req)

0 commit comments

Comments
 (0)