From cc50c794ba2327a955945f9b0c8b133c091d50a3 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 20 Oct 2015 16:24:08 -0700 Subject: [PATCH] Specify response status codes (delete, create) Fixes #28 --- handlers/entities.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handlers/entities.go b/handlers/entities.go index 0b1b2d1..62a6e72 100644 --- a/handlers/entities.go +++ b/handlers/entities.go @@ -110,7 +110,10 @@ func handleCreater(c api.Creater) errorHandler { if err != nil { return newJSONError(err, http.StatusInternalServerError) } + + w.WriteHeader(http.StatusCreated) w.Write(data) + return nil } } @@ -129,6 +132,8 @@ func handleDeleter(d api.Deleter) errorHandler { return appErr } + w.WriteHeader(http.StatusNoContent) + return nil } }