http
http copied to clipboard
API for connection auto-close
Sometimes I need to make a GET
request, and terminate connection before receiving body, so I end up with having something like:
def get_cookies(...)
http = HTTP.headers(...)
http.get(...).cookies
ensure
http.close
end
Sometimes I want to guarantee that connection is closed in case of error while I was streaming response... So, probably it worth to provide API like:
http = HTTP.headers(...)
http.get(...) { |res| ... }
:+1:
SGs
Sent from my iPhone
On Dec 12, 2015, at 07:12, Erik Michaels-Ober [email protected] wrote:
— Reply to this email directly or view it on GitHub.
:+1: :+1: :+1: