func (w *jsonIndentResponseWriter) WriteHeader(code int) {
	w.ResponseWriter.WriteHeader(code)
	w.wroteHeader = true
}
Call the parent WriteHeader.
package rest
import (
	"bufio"
	"encoding/json"
	"net"
	"net/http"
)
type JsonIndentMiddleware struct {
	Prefix string
	Indent string
}
func (mw *JsonIndentMiddleware) MiddlewareFunc(handler HandlerFunc) HandlerFunc {
	if mw.Indent == "" {
		mw.Indent = "  "
	}
	return func(w ResponseWriter, r *Request) {
		writer := &jsonIndentResponseWriter{w, false, mw.Prefix, mw.Indent}
		handler(writer, r)
	}
}
type jsonIndentResponseWriter struct {
	ResponseWriter
	wroteHeader bool
	prefix      string
	indent      string
}
func (w *jsonIndentResponseWriter) EncodeJson(v interface{}) ([]byte, error) {
	b, err := json.MarshalIndent(v, w.prefix, w.indent)
	if err != nil {
		return nil, err
	}
	return b, nil
}
func (w *jsonIndentResponseWriter) WriteJson(v interface{}) error {
	b, err := w.EncodeJson(v)
	if err != nil {
		return err
	}
	_, err = w.Write(b)
	if err != nil {
		return err
	}
	return nil
}