(reqUrl string,
reqParams map[string]interface{}, headers map[string]string)
| 89 | } |
| 90 | |
| 91 | func (target HttpClient) Put(reqUrl string, |
| 92 | reqParams map[string]interface{}, headers map[string]string) (string, error) { |
| 93 | |
| 94 | result := "" |
| 95 | var err error = nil |
| 96 | |
| 97 | Retry(target.RetryMax, target.Sleep, func() error { |
| 98 | result, err = target.put(reqUrl, reqParams, headers) |
| 99 | if err == nil { |
| 100 | if result == "" { |
| 101 | err = errors.New("response body is empty") |
| 102 | } else if !IsJSON(result) { |
| 103 | err = errors.New("response body is not json") |
| 104 | } |
| 105 | } |
| 106 | return err |
| 107 | }) |
| 108 | |
| 109 | return result, err |
| 110 | } |
| 111 | |
| 112 | func (target HttpClient) PostJson(reqUrl string, |
| 113 | reqParams map[string]interface{}, headers map[string]string) (string, error) { |
no test coverage detected