未验证 提交 6d45c9cb 编写于 作者: Z zhuxiaoyang

fix jenkins request func parameters

Signed-off-by: Nzhuxiaoyang <sunzhu@yunify.com>
上级 1b67c437
......@@ -84,7 +84,7 @@ func (r *Requester) PostJSON(endpoint string, payload io.Reader, responseStruct
}
ar.SetHeader("Content-Type", "application/x-www-form-urlencoded")
ar.Suffix = "api/json"
return r.Do(ar, &responseStruct, querystring)
return r.Do(ar, responseStruct, querystring)
}
func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string) (*http.Response, error) {
......@@ -94,7 +94,7 @@ func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct inte
}
ar.SetHeader("Content-Type", "application/x-www-form-urlencoded")
ar.Suffix = ""
return r.Do(ar, &responseStruct, querystring)
return r.Do(ar, responseStruct, querystring)
}
func (r *Requester) PostForm(endpoint string, payload io.Reader, responseStruct interface{}, formString map[string]string) (*http.Response, error) {
ar := NewAPIRequest("POST", endpoint, payload)
......@@ -103,7 +103,7 @@ func (r *Requester) PostForm(endpoint string, payload io.Reader, responseStruct
}
ar.SetHeader("Content-Type", "application/x-www-form-urlencoded")
ar.Suffix = ""
return r.DoPostForm(ar, &responseStruct, formString)
return r.DoPostForm(ar, responseStruct, formString)
}
func (r *Requester) PostFiles(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string, files []string) (*http.Response, error) {
......@@ -111,7 +111,7 @@ func (r *Requester) PostFiles(endpoint string, payload io.Reader, responseStruct
if err := r.SetCrumb(ar); err != nil {
return nil, err
}
return r.Do(ar, &responseStruct, querystring, files)
return r.Do(ar, responseStruct, querystring, files)
}
func (r *Requester) PostXML(endpoint string, xml string, responseStruct interface{}, querystring map[string]string) (*http.Response, error) {
......@@ -122,14 +122,14 @@ func (r *Requester) PostXML(endpoint string, xml string, responseStruct interfac
}
ar.SetHeader("Content-Type", "application/xml;charset=utf-8")
ar.Suffix = ""
return r.Do(ar, &responseStruct, querystring)
return r.Do(ar, responseStruct, querystring)
}
func (r *Requester) GetJSON(endpoint string, responseStruct interface{}, query map[string]string) (*http.Response, error) {
ar := NewAPIRequest("GET", endpoint, nil)
ar.SetHeader("Content-Type", "application/json")
ar.Suffix = "api/json"
return r.Do(ar, &responseStruct, query)
return r.Do(ar, responseStruct, query)
}
func (r *Requester) GetXML(endpoint string, responseStruct interface{}, query map[string]string) (*http.Response, error) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册