Skip to content

Improve printing of empty, unrecognizable and non-raw bodies #40

@akashivskyy

Description

@akashivskyy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions