(path, destination_path)
| 569 | end |
| 570 | |
| 571 | def upload(path, destination_path) |
| 572 | destination_url = build_api_url(destination_path) |
| 573 | with_retry(3, destination_url) do |
| 574 | headers = { |
| 575 | "Content-Length" => File.size(path).to_s, |
| 576 | "Content-Type" => content_type(path), |
| 577 | } |
| 578 | File.open(path, "rb") do |input| |
| 579 | request(:put, headers, destination_url, body: input) |
| 580 | end |
| 581 | end |
| 582 | end |
| 583 | |
| 584 | private |
| 585 | def build_read_url(path) |