From: takashikkbn@... Date: 2020-03-11T04:57:24+00:00 Subject: [ruby-core:97444] [Ruby master Feature#16686] Let Net::HTTP.get take request headers Issue #16686 has been reported by k0kubun (Takashi Kokubun). ---------------------------------------- Feature #16686: Let Net::HTTP.get take request headers https://bugs.ruby-lang.org/issues/16686 * Author: k0kubun (Takashi Kokubun) * Status: Open * Priority: Normal ---------------------------------------- When we need to write a script requesting an HTTP API with GET method which requires authentication by a request header, it'd be nice if we can simply: ```rb Net::HTTP.get(URI("https://api.example.com/user"), { "Authorization" => "apikey" }) ``` Currently the arguments of the `Net::HTTP.get` family are overloaded by `(String, String, Integer)` and `(URI)`. This ticket aims to extend only the latter one to `(URI, Hash)`. The new interface will also be consistent with [Feature #12375]. -- https://bugs.ruby-lang.org/ Unsubscribe: