From a8918e59d08adbf2707f7a9d5b49c500fe213864 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 9 Jul 2018 19:01:03 +0200 Subject: [PATCH] Try to create better request --- cmd/eksterd/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/eksterd/main.go b/cmd/eksterd/main.go index ab0ceea..6e2a694 100644 --- a/cmd/eksterd/main.go +++ b/cmd/eksterd/main.go @@ -163,9 +163,11 @@ func (h *mainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { reqData.Set("client_id", sess.ClientID) reqData.Set("redirect_uri", sess.RedirectURI) - req, err := http.NewRequest("POST", sess.AuthorizationEndpoint, strings.NewReader(reqData.Encode())) + // resp, err := http.PostForm(sess.AuthorizationEndpoint, reqData) + req, err := http.NewRequest(http.MethodPost, sess.AuthorizationEndpoint, strings.NewReader(reqData.Encode())) req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/x-www-form-urlencoded") + req.Write(os.Stderr) client := http.Client{} resp, err := client.Do(req) if err != nil {