diff --git a/prototype.go b/prototype.go index 65ef475..798e012 100644 --- a/prototype.go +++ b/prototype.go @@ -15,7 +15,7 @@ type PrototypeRequestBuilder interface { type Response interface { Header() (header Header) - Bytes() (body []byte) + BodyBytes() (body []byte) } type PrototypeResponse interface { @@ -25,7 +25,7 @@ type PrototypeResponse interface { type ErrorResponse interface { Ok() (ok bool) HttpStatus() (code int) - Bytes() (body []byte) + BodyBytes() (body []byte) String() (out string) Error() (out string) } diff --git a/server.go b/server.go index d99318e..602cf98 100644 --- a/server.go +++ b/server.go @@ -56,7 +56,7 @@ func (srv *server) PostServeFunc(serve ServeFunc) *server { func (srv *server) handleError(errRes ErrorResponse, w http.ResponseWriter) (ok bool) { if !errRes.Ok() { w.WriteHeader(errRes.HttpStatus()) - w.Write(errRes.Bytes()) + w.Write(errRes.BodyBytes()) srv.logger.Logf(log.LevelError, errRes.String()) return false } @@ -95,5 +95,5 @@ func (srv *server) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } } - w.Write(res.Bytes()) + w.Write(res.BodyBytes()) }