- add many TestCallbackMsgPlayback.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user