Skip to content

Improved handling of encoded/binary bodies #523

@mattprecious

Description

@mattprecious

💡 Describe the solution you'd like

It would be great if we could optionally provide a custom decoder to handle bodies that aren't plain text. We use protocol buffers, so I would like to be able to print something useful inside Chucker instead of (encoded or binary body omitted).

📊 Describe alternatives you've considered

None

📄 Additional context

An interface with a function that takes the Request/Response and returns a string would probably be enough.

Something like this, but with better naming:

interface BodyDecoder { // Converter?
  fun decodeRequest(request: Request): String?
  fun decodeResponse(response: Response): String?
}

Or maybe you do converter factories like retrofit 🤷

🙋 Do you want to develop this feature yourself?

  • Yes
  • No

Metadata

Metadata

Assignees

Labels

feature requestRequest a new feature to be developed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions