diff options
Diffstat (limited to 'server/psr7/response.go')
-rw-r--r-- | server/psr7/response.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/psr7/response.go b/server/psr7/response.go new file mode 100644 index 00000000..c0d739a7 --- /dev/null +++ b/server/psr7/response.go @@ -0,0 +1,21 @@ +package psr7 + +import ( + "net/http" +) + +type Response struct { + Status int `json:"status"` + Headers map[string][]string `json:"headers"` +} + +func (r *Response) Write(w http.ResponseWriter) { + for k, v := range r.Headers { + for _, h := range v { + w.Header().Add(k, h) + + } + } + + w.WriteHeader(r.Status) +} |