| 42 | } |
| 43 | |
| 44 | func DownloadWithParam(baseParams BaseParams, dlt downloader.DlType, body interface{}) (id string, err error) { |
| 45 | baseParams.Method = http.MethodPost |
| 46 | msg := cos.MustMarshal(body) |
| 47 | reqParams := AllocRp() |
| 48 | { |
| 49 | reqParams.BaseParams = baseParams |
| 50 | reqParams.Path = apc.URLPathDownload.S |
| 51 | reqParams.Body = cos.MustMarshal(downloader.DlBody{Type: dlt, RawMessage: msg}) |
| 52 | reqParams.Header = http.Header{cos.HdrContentType: []string{cos.ContentJSON}} |
| 53 | } |
| 54 | id, err = reqParams.doDlDownloadRequest() |
| 55 | FreeRp(reqParams) |
| 56 | return |
| 57 | } |
| 58 | |
| 59 | func DownloadMulti(baseParams BaseParams, description string, bck cmn.Bck, msg interface{}, intervals ...time.Duration) (string, error) { |
| 60 | dlBody := downloader.DlMultiBody{} |