It looks like you're new here. If you want to get involved, click one of these buttons!
api = "64bcc44904983cef9fba6b7c783e186bba7ffe95" -- required gID = "K6ix5F3lA" --game ID (test game setup through Scoreoid response = "json" function getPlayer(username, password) -- accepts username and password, returns user info local headers = { ["Authorization"] = "Basic" } local method = UrlLoader.POST local body = "api_key="..api.."&game_id="..gID.."&response="..response.."&username="..username.."&password="..password local url = "<a href="http://www.scoreoid.com/api/getPlayer/"" rel="nofollow">http://www.scoreoid.com/api/getPlayer/"</a>; local loader = UrlLoader.new(url, method, headers, body) local function onComplete(event) print(event.data) end local function onError() print("error") end local function onProgress(event) print("progress: " .. event.bytesLoaded .. " of " .. event.bytesTotal) end loader:addEventListener(Event.COMPLETE, onComplete) loader:addEventListener(Event.ERROR, onError) loader:addEventListener(Event.PROGRESS, onProgress) end getPlayer("username", "password") |
Comments
Ok you need to include content type in header as:
Thanks