- weimob wsc api
This commit is contained in:
@@ -58,6 +58,10 @@ const (
|
||||
ErrLevelCodeIsNotOK = "JXC4_CODE_IS_NOT_OK"
|
||||
)
|
||||
|
||||
const (
|
||||
maxDataSizeDontOutput = 200 * 1024
|
||||
)
|
||||
|
||||
// common api access error
|
||||
var (
|
||||
ErrAPIAccessFailed = errors.New("access API failed")
|
||||
@@ -77,7 +81,11 @@ func init() {
|
||||
}
|
||||
|
||||
func getClonedData(r *bytes.Buffer) string {
|
||||
return string(r.Bytes())
|
||||
retVal := string(r.Bytes())
|
||||
if len(retVal) > maxDataSizeDontOutput {
|
||||
return "request data is too large"
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.Request, config *APIConfig, handleResponse func(bodyMap map[string]interface{}) (string, error)) error {
|
||||
|
||||
Reference in New Issue
Block a user