"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
rest: add optional GetBody function for HTTP call
Paul4af0c1d90220
diff --git a/lib/rest/rest.go b/lib/rest/rest.goindex b5f575ce7..7303ec184 100644--- a/lib/rest/rest.go+++ b/lib/rest/rest.go@@ -130,7 +130,8 @@ type Opts struct {Path string // relative to RootURLRootURL string // override RootURL passed into SetRoot()Body io.Reader- NoResponse bool // set to close Body+ GetBody func() (io.ReadCloser, error) // body builder, needed to enable low-level HTTP/2 retries+ NoResponse bool // set to close BodyContentType stringContentLength *int64ContentRange string@@ -239,6 +240,9 @@ func (api *Client) Call(ctx context.Context, opts *Opts) (resp *http.Response, eif len(opts.TransferEncoding) != 0 {req.TransferEncoding = opts.TransferEncoding}+ if opts.GetBody != nil {+ req.GetBody = opts.GetBody+ }if opts.Trailer != nil {req.Trailer = *opts.Trailer}