You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/01/10 03:38:29 UTC
[17/50] incubator-trafficcontrol git commit: update client to always
use method passed into it when sending requests to TO
update client to always use method passed into it when sending requests to TO
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9341fb1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9341fb1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9341fb1a
Branch: refs/heads/master
Commit: 9341fb1ae0c3e5c1145499c87bdf07a33444938c
Parents: 306c861
Author: David Neuman <da...@gmail.com>
Authored: Wed Nov 30 11:34:53 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Sun Jan 8 21:04:59 2017 -0700
----------------------------------------------------------------------
traffic_ops/client/traffic_ops.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9341fb1a/traffic_ops/client/traffic_ops.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/traffic_ops.go b/traffic_ops/client/traffic_ops.go
index 27e94b3..beb03ff 100644
--- a/traffic_ops/client/traffic_ops.go
+++ b/traffic_ops/client/traffic_ops.go
@@ -194,14 +194,14 @@ func (to *Session) request(method, path string, body []byte) (*http.Response, er
var req *http.Request
var err error
- if body != nil && method != "GET" {
+ if body != nil {
req, err = http.NewRequest(method, url, bytes.NewBuffer(body))
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
} else {
- req, err = http.NewRequest("GET", url, nil)
+ req, err = http.NewRequest(method, url, nil)
if err != nil {
return nil, err
}