You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
424 B

package render
import (
"net/http"
)
type Render interface {
// Render 使用自定义 ContentType 写入数据。
Render(http.ResponseWriter) error
// WriteContentType 写入自定义 ContentType。
WriteContentType(w http.ResponseWriter)
}
func writeContentType(w http.ResponseWriter, value []string) {
header := w.Header()
if val := header["Content-Type"]; len(val) == 0 {
header["Content-Type"] = value
}
}