Simplify token requests

This commit is contained in:
Brian Cain 2015-09-15 10:40:36 -07:00
parent c9dd50716e
commit 562b811867

View file

@ -6,10 +6,7 @@ class Auth
def self.get_token(verbose, url, user, password)
conn = Http.get_conn_with_auth(verbose, url, user, password)
resp = conn.post do |req|
req.url '/token'
req.headers['Content-Type'] = 'application/json'
end
resp = conn.post "/token"
resp_body = JSON.parse(resp.body)
if resp_body["ok"]