Commit f275bf7f authored by Administrator's avatar Administrator

Update client.go

parent 8c00a559
...@@ -77,7 +77,7 @@ func (c *client) GetWithProxy(ctx *context.UlfsaarContext, path, ip, port string ...@@ -77,7 +77,7 @@ func (c *client) GetWithProxy(ctx *context.UlfsaarContext, path, ip, port string
for h, val := range headers { for h, val := range headers {
request.Header[h] = val request.Header[h] = val
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Get(urls) httpResp, httpErr := request.Get(urls)
...@@ -117,7 +117,7 @@ func (c *client) GetWithProxyAuth(ctx *context.UlfsaarContext, path, ip, port, u ...@@ -117,7 +117,7 @@ func (c *client) GetWithProxyAuth(ctx *context.UlfsaarContext, path, ip, port, u
for h, val := range headers { for h, val := range headers {
request.Header[h] = val request.Header[h] = val
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Get(urls) httpResp, httpErr := request.Get(urls)
for httpErr != nil { for httpErr != nil {
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
...@@ -171,7 +171,7 @@ func (c *client) PostWithProxy(ctx *context.UlfsaarContext, path, ip, port, user ...@@ -171,7 +171,7 @@ func (c *client) PostWithProxy(ctx *context.UlfsaarContext, path, ip, port, user
if headers[ContentType] == nil { if headers[ContentType] == nil {
request.Header.Set(ContentType, ApplicationJSON) request.Header.Set(ContentType, ApplicationJSON)
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Post(uri) httpResp, httpErr := request.Post(uri)
...@@ -209,7 +209,7 @@ func (c *client) Post(ctx *context.UlfsaarContext, path string, headers http.Hea ...@@ -209,7 +209,7 @@ func (c *client) Post(ctx *context.UlfsaarContext, path string, headers http.Hea
if headers[ContentType] == nil { if headers[ContentType] == nil {
request.Header.Set(ContentType, ApplicationJSON) request.Header.Set(ContentType, ApplicationJSON)
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Post(url) httpResp, httpErr := request.Post(url)
...@@ -247,7 +247,7 @@ func (c *client) PostFormData(ctx *context.UlfsaarContext, path string, headers ...@@ -247,7 +247,7 @@ func (c *client) PostFormData(ctx *context.UlfsaarContext, path string, headers
if headers[ContentType] == nil { if headers[ContentType] == nil {
request.Header.Set(ContentType, ApplicationJSON) request.Header.Set(ContentType, ApplicationJSON)
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Post(url) httpResp, httpErr := request.Post(url)
...@@ -331,7 +331,7 @@ func (c *client) PostMultipartFormFilesAndData(ctx *context.UlfsaarContext, path ...@@ -331,7 +331,7 @@ func (c *client) PostMultipartFormFilesAndData(ctx *context.UlfsaarContext, path
for h, val := range headers { for h, val := range headers {
request.Header[h] = val request.Header[h] = val
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Post(url) httpResp, httpErr := request.Post(url)
...@@ -370,7 +370,7 @@ func (c *client) Put(ctx *context.UlfsaarContext, path string, headers http.Head ...@@ -370,7 +370,7 @@ func (c *client) Put(ctx *context.UlfsaarContext, path string, headers http.Head
if headers[ContentType] == nil { if headers[ContentType] == nil {
request.Header.Set(ContentType, ApplicationJSON) request.Header.Set(ContentType, ApplicationJSON)
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
request.SetBody(payload) request.SetBody(payload)
...@@ -406,7 +406,7 @@ func (c *client) Get(ctx *context.UlfsaarContext, path string, headers http.Head ...@@ -406,7 +406,7 @@ func (c *client) Get(ctx *context.UlfsaarContext, path string, headers http.Head
for h, val := range headers { for h, val := range headers {
request.Header[h] = val request.Header[h] = val
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Get(url) httpResp, httpErr := request.Get(url)
...@@ -440,7 +440,7 @@ func (c *client) GetWithQueryParam(ctx *context.UlfsaarContext, path string, hea ...@@ -440,7 +440,7 @@ func (c *client) GetWithQueryParam(ctx *context.UlfsaarContext, path string, hea
for h, val := range headers { for h, val := range headers {
request.Header[h] = val request.Header[h] = val
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
request.SetQueryParams(queryParam) request.SetQueryParams(queryParam)
httpResp, httpErr := request.Get(url) httpResp, httpErr := request.Get(url)
...@@ -475,7 +475,7 @@ func (c *client) Delete(ctx *context.UlfsaarContext, path string, headers http.H ...@@ -475,7 +475,7 @@ func (c *client) Delete(ctx *context.UlfsaarContext, path string, headers http.H
for h, val := range headers { for h, val := range headers {
request.Header[h] = val request.Header[h] = val
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
request.SetBody(payload) request.SetBody(payload)
...@@ -515,7 +515,7 @@ func (c *client) Patch(ctx *context.UlfsaarContext, path string, headers http.He ...@@ -515,7 +515,7 @@ func (c *client) Patch(ctx *context.UlfsaarContext, path string, headers http.He
if headers[ContentType] == nil { if headers[ContentType] == nil {
request.Header.Set(ContentType, ApplicationJSON) request.Header.Set(ContentType, ApplicationJSON)
} }
request.Header.Set(UserAgent, UserAgentValue) //request.Header.Set(UserAgent, UserAgentValue)
httpResp, httpErr := request.Patch(url) httpResp, httpErr := request.Patch(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment