refactor: support AbortWithStatusJSON (#200)

This commit is contained in:
Bo-Yi Wu
2017-03-29 09:21:31 +08:00
committed by GitHub
parent d94c9437f5
commit 5b2b3695e5
67 changed files with 55188 additions and 128 deletions

View File

@@ -16,6 +16,10 @@ type XML struct {
var xmlContentType = []string{"application/xml; charset=utf-8"}
func (r XML) Render(w http.ResponseWriter) error {
writeContentType(w, xmlContentType)
r.WriteContentType(w)
return xml.NewEncoder(w).Encode(r.Data)
}
func (r XML) WriteContentType(w http.ResponseWriter) {
writeContentType(w, xmlContentType)
}