Changed assets endpoint to multipart
This commit is contained in:
@@ -16,9 +16,10 @@ import (
|
||||
|
||||
type testInformation struct {
|
||||
Method string
|
||||
Header map[string]string
|
||||
Cookie map[string]string
|
||||
Body interface{}
|
||||
Query map[string]interface{}
|
||||
Cookie map[string]string
|
||||
|
||||
ResultBody interface{}
|
||||
ResultCookie []string
|
||||
@@ -57,8 +58,12 @@ func checkTestInformation(t *testing.T, url string, information []testInformatio
|
||||
for i, information := range information {
|
||||
var body io.Reader
|
||||
if information.Body != nil {
|
||||
buf, _ := json.Marshal(information.Body)
|
||||
body = bytes.NewReader(buf)
|
||||
if b, ok := information.Body.([]byte); ok {
|
||||
body = bytes.NewReader(b)
|
||||
} else {
|
||||
buf, _ := json.Marshal(information.Body)
|
||||
body = bytes.NewReader(buf)
|
||||
}
|
||||
}
|
||||
|
||||
query := url2.Values{}
|
||||
@@ -77,6 +82,11 @@ func checkTestInformation(t *testing.T, url string, information []testInformatio
|
||||
})
|
||||
}
|
||||
}
|
||||
if information.Header != nil {
|
||||
for name, value := range information.Header {
|
||||
req.Header.Set(name, value)
|
||||
}
|
||||
}
|
||||
|
||||
resp, _ := http.DefaultClient.Do(req)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user