-
Sometimes we need to respond with a plain string (e.g. Prometheus Metrics or OpenAPI spec).
But if I try to use it like this:
I get a
Is it expected? |
Beta Was this translation helpful? Give feedback.
Answered by
RobinTail
Feb 26, 2023
Replies: 1 comment
-
Yes. On the level of middlewares and endpoints you can only operate objects. You need a custom ResultHandler. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RobinTail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes. On the level of middlewares and endpoints you can only operate objects.
However, the final response is the duty of ResultHandler.
You need a custom ResultHandler.
Check out the documentation and file download/streaming example in this repo.
It exactly responds with a string, @McMerph