Skip to content

Instantly share code, notes, and snippets.

@creationix
Last active August 29, 2015 14:17
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 creationix/c67879797bffa9b81f33 to your computer and use it in GitHub Desktop.
Save creationix/c67879797bffa9b81f33 to your computer and use it in GitHub Desktop.
local request = require('coro-http').request
local json = require('json')
local body = json.stringify({
['auth'] = {
['RAX-KSKEY:apiKeyCredentials'] = {
['username'] = '',
['apiKey'] = '',
}
}
})
coroutine.wrap(function ()
local res, resBody = request("POST", "https://identity.api.rackspacecloud.com/v2.0/tokens", {
{'Content-type', 'application/json'},
{'Content-length', #body}
}, body)
p(resBody)
p(res)
p(json.parse(resBody))
os.exit()
end)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment