ResponseDetective icon indicating copy to clipboard operation
ResponseDetective copied to clipboard

Improve printing of empty, unrecognizable and non-raw bodies

Open akashivskyy opened this issue 8 years ago • 0 comments

Currently ResponseDetective prints <none> for bodies in the following situations:

  1. when the body is empty, i.e. has 0 bytes;
  2. and when the body cannot be deserialized, i.e. has an unsupported content-type.

The 2nd situation might be confusing as <none> might suggest that a request has an empty body.

The proposal is to improve handling of empty and non-deserializable bodies in the following way:

  1. for empty bodies → print <empty>;
  2. for non-deserializable bodies → print <unrecognizable x bytes>.

In addition, other non-raw bodies, such as 1px × 1px image for image/* content-type, should also be wrapped in triangular brackets (i.e. <1px × 1px image>) so that it can be distinguished from plain text bodies with similar contents.

akashivskyy avatar Aug 17 '17 09:08 akashivskyy