mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-12 23:05:56 +00:00
Merge pull request #12 from sairez/master
add ability to use SSL to contact haste-server
This commit is contained in:
@@ -26,6 +26,10 @@ module Haste
|
||||
def start
|
||||
uri = URI.parse server
|
||||
http = Net::HTTP.new uri.host, uri.port
|
||||
if uri.scheme =~ /^https/
|
||||
http.use_ssl = true
|
||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||
end
|
||||
response = http.post '/documents', @input
|
||||
if response.is_a?(Net::HTTPOK)
|
||||
data = JSON.parse(response.body)
|
||||
|
||||
Reference in New Issue
Block a user