Closed ousado closed 4 years ago
If you need full control, then you can always form a full OutgoingResponse.
The point of @:consumes
/@:produces
is tell tink_web how to represent payload over the wire. But indeed, it could also signal the content-type for raw bodies.
I see, thanks. It would make sense to be able to set the content-type easily and directly, though, wouldn't it? Something like @:contentType(...) perhaps?
Yup. Kevin had also suggested @:header(name, value)
a while ago. Something of the sort is probably useful ;)
@:header
is implemented but I am not sure if it works in this case. Because the content-type header is already added. Perhaps content-type needs special treatment.
The content-type for RealSource and IdealSource is hardcoded.
@:produces is being ignored.
https://github.com/haxetink/tink_web/blob/5c82edd65039f5a071d700e026b76777d164a091/src/tink/web/routing/Response.hx#L19