- add many TestCallbackMsgPlayback.

This commit is contained in:
gazebo
2018-06-29 10:41:18 +08:00
parent 8c4e92f5ef
commit 6b865b5f4c
4 changed files with 130 additions and 0 deletions

View File

@@ -289,3 +289,13 @@ func GenerateGetURL(baseURL, apiStr string, params map[string]interface{}) strin
}
return baseURL + "/" + apiStr + queryString
}
func SendFakeRequest(method, url, body, contentType string) (*http.Response, error) {
request, _ := http.NewRequest(method, url, strings.NewReader(body))
if contentType == "" {
contentType = "application/x-www-form-urlencoded"
}
request.Header.Set("Content-Type", contentType)
client := &http.Client{}
return client.Do(request)
}