Clean up log output if a diag request has no payload.
Add helper functions to render requests and responses as strings.