Bug #20077
closed
- Status changed from Open to Feedback
It would be good if you could outline in more detail:
- What, exactly, about net/http you find hard to use?
- Some use-cases where net/http causes problems which could be improved with a different client interface
- Why this use-case can't be solved by using one of the many popular Rubygems for this, like Faraday, HTTParty, etc?
- What you feel the relationship between stdlib & these gems should be?
- Since you mentioned that it's "very very old", whether there is something specific about its age which is a problem? (e.g. are there design assumptions it makes which no longer stack up today?)
Without a more specific use-case beyond "net/http is hard to use" it's hard to have a meaningful discussion.
For GET and POST, modern Ruby does have APIs that aren't hard to use. I wonder if you have used them.
HTTP.get return body as string,
other http method return response
there is get_print, maybe for scripting.
HTTP:Client api is also hard to use.
can we deprecate net/*
and get an modern http client (or server) in std.
http.rb is great.
HTTP.get return body as string,
other http method return response
there is get_print, maybe for scripting.
If you look at what HTTP.get
does, it's just HTTP.get_response(...).body
. You may use HTTP.get_response
for that purpose.
I know,but this is the bad part,they are http verb,but some return response,some return body string.
all verb method should return response object, modify net/http will break compatibility.
so I suggest opt out net/http and webrick, introduce new http/client and http/server based on llhttp that nodejs used.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0