Question

All I want is to do a POST like this:

You can post a score or a user by issuing an HTTP POST request to /USER_ID/scores with the app access_token as long as you have the publish_actions permission.

Name Description Type Required score numeric score with value > 0. integer yes

I am doing this:

try {
    http.request( POST, URLENC ) {
        uri.path = "/100000781309474/scores?" + user.accessToken 
        body =  [score:10]

        response.success = { resp ->
            println "Tweet response status: ${resp.statusLine}"
            assert resp.statusLine.statusCode == 200
        }

        response.failure = { resp ->
            println "Unexpected error: ${resp.status} : ${resp.statusLine.reasonPhrase}"
        }
    }
} catch ( HttpResponseException ex ) {
    // default failure handler throws an exception:
    println "Unexpected response error: ${ex.statusCode}"
}

but it's returning this exception:

400: Bad request

It means that the POST isn't correct, yes?

Can someone tell me how to do the post with the user score?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top