我正在尝试使用 CURL API 将一个 tgz 包推送到 Artifactory,但该文件包含未推送它的空格。我有以下命令,有人可以提供一些建议吗?
curl -u admin:pwd -X PUT https://test.todo.com/artifactory/jenkins-transfer/migrate-man/central/central-test data.tgz -T /data5/central-test data.tgz
错误是:
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0<!doctype html><html lang="en"><head><title>HTTP Status 505 ��� HTTP Version Not Supported</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;}
答案1
我会尝试将包含空格的项目放在引号内,例如:
curl -u admin:pwd -X PUT "https://test.todo.com/artifactory/jenkins-transfer/migrate-man/central/central-test data.tgz" -T "/data5/central-test data.tgz"