diff options
author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2022-11-16 13:33:19 -0600 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-11-19 10:17:54 -0500 |
commit | 2047636af81d08d20a083fdd08cc771d772eecfb (patch) | |
tree | 40f8109c02ce5c2bf0bc02e39bfa7cafcc3b9874 /lib | |
parent | dbb902fc91b8b9a298d8656830f724c767345969 (diff) | |
download | ruby-2047636af81d08d20a083fdd08cc771d772eecfb.tar.gz |
[ruby/net-http] Update lib/net/http/request.rb
https://github.com/ruby/net-http/commit/e3c9011edb
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http/request.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/net/http/request.rb b/lib/net/http/request.rb index 1a6e588495..f61697d1a8 100644 --- a/lib/net/http/request.rb +++ b/lib/net/http/request.rb @@ -54,12 +54,10 @@ # # A POST request may be sent using request class \Net::HTTP::Post: # -# json = {title: 'foo', body: 'bar', userId: 1} -# # => "{\"title\":\"foo\",\"body\":\"bar\",\"userId\":1}" # _uri = uri.dup # _uri.path = '/posts' # req = Net::HTTP::Post.new(_uri) # => #<Net::HTTP::Post POST> -# req.body = json +# req.body = '{"title": "foo", "body": "bar", "userId": 1}' # req['Content-type'] = 'application/json; charset=UTF-8' # Net::HTTP.start(hostname) do |http| # http.request(req) |