Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-479

getResponseBody always logs messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 3.0 RC3
    • None
    • HttpClient (classic)
    • None
    • Operating System: All
      Platform: Other
    • 35728

    Description

      Whenever I use getResponseBody or getResponseBodyAsString I get a warning in the
      log that I shouldn't do this. Either deprecate these methods or accept that
      there are valid usecases for using them and remove the warning.

      In my case I usually get the response to do stuff with it in memory. That
      usually requires having either a bytearray or a string (i.e. it is a design
      choice, I accept the memory overhead). I suppose that's why these methods are
      part of the API (and I suspect they are used frequently).

      IMHO in general components like httpclient should always be silent and rely on
      proper exception handling so that the user can decide whether to log exceptions,
      errors, etc. It certainly shouldn't try to educate the programmer in through
      logging messages.

      Now I need to write code to avoid the log filling with useless warnings (my
      customers hate noisy logs). I shouldn't have to that.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              incoming@jillesvangurp.com Jilles van Gurp
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: