From 81cbea4ff8c17d259733c12ccb78c9a6785e803c Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Thu, 17 Oct 2019 16:58:38 +0200 Subject: [PATCH] Fix method used in client.AddRoute() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: César Gallego --- internal/client/route_add.go | 2 +- internal/client/route_add_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/client/route_add.go b/internal/client/route_add.go index 378f2cb..e1cc767 100644 --- a/internal/client/route_add.go +++ b/internal/client/route_add.go @@ -16,5 +16,5 @@ func AddRoute(host, path, method, entrypoint, command string, w io.Writer) error "url_pattern": path, "entrypoint": entrypoint, "command": command}) - return http.Put(url, "application/json", bytes.NewReader(body), w) + return http.Post(url, "application/json", bytes.NewReader(body), w) } diff --git a/internal/client/route_add_test.go b/internal/client/route_add_test.go index 6ff567c..4940388 100644 --- a/internal/client/route_add_test.go +++ b/internal/client/route_add_test.go @@ -10,7 +10,7 @@ import ( func TestSuccessOnCorrectRoute(t *testing.T) { defer gock.Off() gock.New("http://localhost"). - Put("/routes"). + Post("/routes"). MatchType("json"). JSON(map[string]string{ "method": "GET",