How to retrieve specific error message from REST request
Hello,
I am working on a StackOverflow integration with Spring Social - I have been able to complete the oauth dance and store the access token, however, when I then try to send a request to their API I get the error message logged:
Code:
GET request for "https://api.stackexchange.com/2.0/me?site=stackoverflow" resulted in 400 (Bad Request); invoking error handler
HttpClientErrorException while completing connection: 400 Bad Request
Response body: ?
I am trying to debug it, Can someone advise how to log the actual response message in the body? Im hoping i if i can find that it should be more straightforward, as I am expecting something like:
Code:
{
"error_id":405,
"error_name":"key_required","
error_message":"`key` is required when `access_token` is passed."
}
Rather than just the high-level 400 error.
Thanks