curl no URL specified using POST

curl no URL specified using POST

从 shell,我正在尝试使用 Fedora Commons 的 REST API 使用 curl 将二进制文件上传到特定位置:

curl -X PUT --upload-file image.jpg -H "Content-Type: image/jpeg" -H "http://localhost:8080/rest/TestUpload/newexcel"

我遇到的错误:

curl: no URL specified!

按照此处的说明进行操作: https://wiki.duraspace.org/display/FEDORA471/RESTful+HTTP+API

-H 用于在向服务器发送 HTTP 时将额外的 header 包含在请求中,您不应在 url.

之前使用它

你可能需要做 curl -X PUT --upload-file image.jpg -H "Content-Type: image/jpeg" http://localhost:8080/rest/TestUpload/newexcel