Results 1 to 4 of 4

Thread: Bug in Spring 3.1.1 RestTemplate Class in retrieving response Buffer on 401 error

  1. #1

    Default Bug in Spring 3.1.1 RestTemplate Class in retrieving response Buffer on 401 error

    I have a RESTful web server implemented with custom authentication and returns 401 plus a JSON response when authentication fails. When the authentication fails as on a GET, all is well and RestTemplate returns back both the status code as well as the JSON response but when we send a POST, the body gets lost. We see that an HttpRetryException is getting called when attempting to retrieve the responseBody. This is in function getResponseBody in DefaultResponseErrorHandler. I assume this means that the response is already retrieved at an earlier point and therefore gets lost.

  2. #2

    Default

    The reason for the difference between GET and PUT is the field doOutput. In the case of the POST it is set to true so the output is read in earlier, in the executeInternal function (SimpleBufferingClientHttpRequest). So, i am not sure what the fix is but i am definitely sure that it is not intended behavior here

  3. #3

    Default

    Is the proper protocol to open a JIRA for this issue?

  4. #4
    Join Date
    Aug 2011
    Location
    Orlando, Florida
    Posts
    1

    Default

    Hi, I can confirm that the same issue is in spring framework 3.1.2 release. A JIRA ticket is created to track the issue:
    https://jira.springsource.org/browse/SPR-9999

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •