Project

General

Profile

Feature #16686

Updated by k0kubun (Takashi Kokubun) about 4 years ago

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 do: 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]. 

 Patch: https://github.com/ruby/ruby/pull/2957

Back