Compare commits

...

2 commits

Author SHA1 Message Date
92f76c5f33 Merge pull request 'add buffer pdf response' (#15) from jacs/core:develop into develop
Reviewed-on: #15
2024-12-08 08:58:08 -05:00
jacs
5d737c6b10 add buffer pdf response 2024-12-08 00:24:44 -05:00

View file

@ -27,6 +27,17 @@ type header struct {
val string val string
} }
// TODO add doc
func (rs *Response) BufferPDF(name string, b bytes.Buffer) *Response {
if rs.isTerminated == false {
rs.HttpResponseWriter.Header().Add("Content-Type", "application/pdf")
rs.HttpResponseWriter.Header().Add("Content-Disposition", "attachment; filename="+name)
b.WriteTo(rs.HttpResponseWriter)
}
return rs
}
// TODO add doc // TODO add doc
func (rs *Response) Any(body any) *Response { func (rs *Response) Any(body any) *Response {
if rs.isTerminated == false { if rs.isTerminated == false {