add buffer pdf response #15
1 changed files with 11 additions and 0 deletions
11
response.go
11
response.go
|
@ -27,6 +27,17 @@ type header struct {
|
|||
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
|
||||
func (rs *Response) Any(body any) *Response {
|
||||
if rs.isTerminated == false {
|
||||
|
|
Loading…
Reference in a new issue