Skip to content

Instantly share code, notes, and snippets.

@rphillips
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rphillips/200e2543b86c0d74b4ad to your computer and use it in GitHub Desktop.
Save rphillips/200e2543b86c0d74b4ad to your computer and use it in GitHub Desktop.
local https = require('https')
local json = require('json')
local body = json.stringify({
['auth'] = {
['RAX-KSKEY:apiKeyCredentials'] = {
['username'] = '',
['apiKey'] = '',
}
}
})
local req = https.request({
host = "identity.api.rackspacecloud.com",
port = 443,
path = "/v2.0/tokens",
method = 'POST',
headers = {
{'Content-type', 'application/json'},
{'Content-length', #body},
},
}, function(res)
res:on('data', p)
res:on('end', function() p('end') end)
end)
req:write(body)
req:done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment