| Puppet::Network::HttpPool.connection, and deprecated methods http_instance and http_ssl_instance, currently return an instance of Puppet::Network::HTTP::Connection which is the legacy way of handling network connections. For this issue, have the connection, etc methods return an adapter that implements the Connection API, but routes the requests through the HTTP client. This should only happen if the http_client_class is not overridden (ie in puppetserver). The adapter should return and raise the same way as the Connection class does. To access these, "unwrap" the response and exception using Puppet::HTTP::Response#nethttp and Puppet::HTTP::HTTPError#cause, respectively. When running in puppetserver, the Puppet::Network::HttpPool.http_client_class will be non-nil, and in that case we should continue returning instances of that class when connection, etc are called. For this ticket, implement the public methods from Puppet::Network::HTTP::Connection on the adapter:
get |
post |
head |
delete |
put |
request_get |
request_head |
request_post |
address |
port |
use_ssl?
|
The request_XXX methods accept a code block and yield the response to it. |