ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:115836] [Ruby master Bug#20077] modern http client
@ 2023-12-21  5:35 pynix (Pynix wang) via ruby-core
  2023-12-21  5:43 ` [ruby-core:115837] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pynix (Pynix wang) via ruby-core @ 2023-12-21  5:35 UTC (permalink / raw)
  To: ruby-core; +Cc: pynix (Pynix wang)

Issue #20077 has been reported by pynix (Pynix wang).

----------------------------------------
Bug #20077: modern http client
https://bugs.ruby-lang.org/issues/20077

* Author: pynix (Pynix wang)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
net/http is very very old and hard to use.

we need a well designed http client in stdlib.





-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:115837] [Ruby master Bug#20077] modern http client
  2023-12-21  5:35 [ruby-core:115836] [Ruby master Bug#20077] modern http client pynix (Pynix wang) via ruby-core
@ 2023-12-21  5:43 ` kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
  2023-12-21 17:18 ` [ruby-core:115840] " k0kubun (Takashi Kokubun) via ruby-core
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core @ 2023-12-21  5:43 UTC (permalink / raw)
  To: ruby-core; +Cc: kjtsanaktsidis (KJ Tsanaktsidis)

Issue #20077 has been updated by kjtsanaktsidis (KJ Tsanaktsidis).

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.

----------------------------------------
Bug #20077: modern http client
https://bugs.ruby-lang.org/issues/20077#change-105791

* Author: pynix (Pynix wang)
* Status: Feedback
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
net/http is very very old and hard to use.

we need a well designed http client in stdlib.





-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:115840] [Ruby master Bug#20077] modern http client
  2023-12-21  5:35 [ruby-core:115836] [Ruby master Bug#20077] modern http client pynix (Pynix wang) via ruby-core
  2023-12-21  5:43 ` [ruby-core:115837] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
@ 2023-12-21 17:18 ` k0kubun (Takashi Kokubun) via ruby-core
  2023-12-21 18:10 ` [ruby-core:115841] " pynix (Pynix wang) via ruby-core
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2023-12-21 17:18 UTC (permalink / raw)
  To: ruby-core; +Cc: k0kubun (Takashi Kokubun)

Issue #20077 has been updated by k0kubun (Takashi Kokubun).


For GET and POST, modern Ruby does have APIs that aren't hard to use. I wonder if you have used them.

* `Net::HTTP.get(uri, headers = {})`: Ruby 3.0+ https://bugs.ruby-lang.org/issues/16686
* `Net::HTTP.post(uri, body, headers = {})`: Ruby 2.4+ https://bugs.ruby-lang.org/issues/12375

----------------------------------------
Bug #20077: modern http client
https://bugs.ruby-lang.org/issues/20077#change-105796

* Author: pynix (Pynix wang)
* Status: Feedback
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
net/http is very very old and hard to use.

we need a well designed http client in stdlib.





-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:115841] [Ruby master Bug#20077] modern http client
  2023-12-21  5:35 [ruby-core:115836] [Ruby master Bug#20077] modern http client pynix (Pynix wang) via ruby-core
  2023-12-21  5:43 ` [ruby-core:115837] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
  2023-12-21 17:18 ` [ruby-core:115840] " k0kubun (Takashi Kokubun) via ruby-core
@ 2023-12-21 18:10 ` pynix (Pynix wang) via ruby-core
  2023-12-21 18:22 ` [ruby-core:115842] " k0kubun (Takashi Kokubun) via ruby-core
  2023-12-22  8:12 ` [ruby-core:115852] " pynix (Pynix wang) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: pynix (Pynix wang) via ruby-core @ 2023-12-21 18:10 UTC (permalink / raw)
  To: ruby-core; +Cc: pynix (Pynix wang)

Issue #20077 has been updated by pynix (Pynix wang).


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.

----------------------------------------
Bug #20077: modern http client
https://bugs.ruby-lang.org/issues/20077#change-105797

* Author: pynix (Pynix wang)
* Status: Feedback
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
net/http is very very old and hard to use.

we need a well designed http client in stdlib.





-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:115842] [Ruby master Bug#20077] modern http client
  2023-12-21  5:35 [ruby-core:115836] [Ruby master Bug#20077] modern http client pynix (Pynix wang) via ruby-core
                   ` (2 preceding siblings ...)
  2023-12-21 18:10 ` [ruby-core:115841] " pynix (Pynix wang) via ruby-core
@ 2023-12-21 18:22 ` k0kubun (Takashi Kokubun) via ruby-core
  2023-12-22  8:12 ` [ruby-core:115852] " pynix (Pynix wang) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2023-12-21 18:22 UTC (permalink / raw)
  To: ruby-core; +Cc: k0kubun (Takashi Kokubun)

Issue #20077 has been updated by k0kubun (Takashi Kokubun).


> 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.

----------------------------------------
Bug #20077: modern http client
https://bugs.ruby-lang.org/issues/20077#change-105798

* Author: pynix (Pynix wang)
* Status: Feedback
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
net/http is very very old and hard to use.

we need a well designed http client in stdlib.





-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:115852] [Ruby master Bug#20077] modern http client
  2023-12-21  5:35 [ruby-core:115836] [Ruby master Bug#20077] modern http client pynix (Pynix wang) via ruby-core
                   ` (3 preceding siblings ...)
  2023-12-21 18:22 ` [ruby-core:115842] " k0kubun (Takashi Kokubun) via ruby-core
@ 2023-12-22  8:12 ` pynix (Pynix wang) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: pynix (Pynix wang) via ruby-core @ 2023-12-22  8:12 UTC (permalink / raw)
  To: ruby-core; +Cc: pynix (Pynix wang)

Issue #20077 has been updated by pynix (Pynix wang).


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.

----------------------------------------
Bug #20077: modern http client
https://bugs.ruby-lang.org/issues/20077#change-105810

* Author: pynix (Pynix wang)
* Status: Feedback
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
net/http is very very old and hard to use.

we need a well designed http client in stdlib.





-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-12-22  8:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21  5:35 [ruby-core:115836] [Ruby master Bug#20077] modern http client pynix (Pynix wang) via ruby-core
2023-12-21  5:43 ` [ruby-core:115837] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
2023-12-21 17:18 ` [ruby-core:115840] " k0kubun (Takashi Kokubun) via ruby-core
2023-12-21 18:10 ` [ruby-core:115841] " pynix (Pynix wang) via ruby-core
2023-12-21 18:22 ` [ruby-core:115842] " k0kubun (Takashi Kokubun) via ruby-core
2023-12-22  8:12 ` [ruby-core:115852] " pynix (Pynix wang) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).