-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to return custom http response data and header #1130
Comments
Hey @brucke, can you please elaborate on the use case where and what response headers you want to send? |
Hey, for instance:
And I have a plain text like: https://de.wikipedia.org/wiki/ICalendar |
Hey @brucke, I understand your use case. We already have the The ideal way would be to add a header field to the response and populate the headers to the responder after the handler is called. |
@vipul-rawat hey can you please assign this issue to me? |
Thanks :) I try it today if it fits my needs. |
Hey @vipul-rawat, I needed a little help. I added a new |
Hey @rigved-telang, replace it until the first gofr folder |
thanks, it worked |
And in the gofr repo itself, the replace line should be |
Hey,
I tried gofr for one of my Projects. I'm realy happy with it, but now I faced a big blocking point to continue with gofr.
I want to return a custom http response.
Data: string
And a lot of http headers
But at the moment I can't find the API to do it. I analyzed the source code and found the Responder and also the response.Raw and response.File but that's not sufficient. I have to add more custom headers. So only way I see at the moment is CustomMiddleware but from my point of view this feels wrong.
Because it's not possible to attach a middleware to a dedicated route only globally.
Has anybody a hit / idea for me?
The text was updated successfully, but these errors were encountered: