为什么使用卷发将Nuget软件包上传到Nexus时错误400输出?
我尝试使用命令行中的卷曲上传到Nexus,但我会收到错误400。
软件包不在存储库中。
ls -l azure.core.1.24.0.nupkg
-rw-rw-r--. 1 ec2-user ec2-user 666796 Jun 8 11:58 azure.core.1.24.0.nupkg
curl -v -u admin:pwd --upload-file ./azure.core.1.24.0.nupkg http://10.20.1.78:8081/repository/package_nuget_for_portal/azure.core.1.24.0.nupkg
* Trying 10.211.1.78...
* TCP_NODELAY set
* Connected to 10.20.1.78 (10.20.1.78) port 8081 (#0)
* Server auth using Basic with user 'admin'
> PUT /repository/package_nuget_for_portal/azure.core.1.24.0.nupkg HTTP/1.1
> Host: 10.20.1.78:8081
> Authorization: Basic YWRtaW46MXEydzNlNHI=
> User-Agent: curl/7.61.1
> Accept: */*
> Content-Length: 666796
> Expect: 100-continue
>
< HTTP/1.1 400 Bad Request
< Date: Sun, 12 Jun 2022 07:49:12 GMT
< Server: Nexus/3.37.3-02 (OSS)
< X-Content-Type-Options: nosniff
< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
< X-XSS-Protection: 1; mode=block
< Content-Type: application/xml
< Content-Length: 228
< Connection: close
<
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>400</code>
<message xml:lang="en-US">Multipart request required</message>
</error>
我在这里想念什么?
I try uploading a NuGet package to Nexus using Curl from command line, but I get the error 400.
The package is not in the repository.
ls -l azure.core.1.24.0.nupkg
-rw-rw-r--. 1 ec2-user ec2-user 666796 Jun 8 11:58 azure.core.1.24.0.nupkg
curl -v -u admin:pwd --upload-file ./azure.core.1.24.0.nupkg http://10.20.1.78:8081/repository/package_nuget_for_portal/azure.core.1.24.0.nupkg
* Trying 10.211.1.78...
* TCP_NODELAY set
* Connected to 10.20.1.78 (10.20.1.78) port 8081 (#0)
* Server auth using Basic with user 'admin'
> PUT /repository/package_nuget_for_portal/azure.core.1.24.0.nupkg HTTP/1.1
> Host: 10.20.1.78:8081
> Authorization: Basic YWRtaW46MXEydzNlNHI=
> User-Agent: curl/7.61.1
> Accept: */*
> Content-Length: 666796
> Expect: 100-continue
>
< HTTP/1.1 400 Bad Request
< Date: Sun, 12 Jun 2022 07:49:12 GMT
< Server: Nexus/3.37.3-02 (OSS)
< X-Content-Type-Options: nosniff
< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
< X-XSS-Protection: 1; mode=block
< Content-Type: application/xml
< Content-Length: 228
< Connection: close
<
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>400</code>
<message xml:lang="en-US">Multipart request required</message>
</error>
What do I miss here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将-h“ multipart/form -data”添加到curl命令中:
或使用nuget命令:
Try adding -H "multipart/form-data" into Curl command:
Or use the Nuget command: