From 1b9ba2f71e5ec6b8fa4a0f702cb663bbf3a4e518 Mon Sep 17 00:00:00 2001 From: Maciej Winnicki Date: Fri, 16 Feb 2018 13:27:37 +0100 Subject: [PATCH] fix status code when creating subscription --- README.md | 4 ++-- httpapi/httpapi.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b00b90f..129f4ad 100644 --- a/README.md +++ b/README.md @@ -441,7 +441,7 @@ JSON object: Status code: -* `200 OK` on success +* `201 Created` on success * `400 Bad Request` on validation error JSON object: @@ -569,7 +569,7 @@ JSON object: Status code: -* `200 OK` on success +* `201 Created` on success * `400 Bad Request` on validation error JSON object: diff --git a/httpapi/httpapi.go b/httpapi/httpapi.go index 243d9f9..a64279d 100644 --- a/httpapi/httpapi.go +++ b/httpapi/httpapi.go @@ -221,6 +221,7 @@ func (h HTTPAPI) createSubscription(w http.ResponseWriter, r *http.Request, para return } + w.WriteHeader(http.StatusCreated) encoder.Encode(output) }