为什么使用卷发将Nuget软件包上传到Nexus时错误400输出?

发布于 2025-02-06 15:08:29 字数 1418 浏览 2 评论 0原文

我尝试使用命令行中的卷曲上传到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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深白境迁sunset 2025-02-13 15:08:29

尝试将-h“ multipart/form -data”添加到curl命令中:

curl -v -u admin:pwd -H "multipart/form-data" --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

或使用nuget命令:

nuget sources add -u admin -p pwd -name myName -Source http://10.20.1.78:8081/repository/package_nuget_for_portal/
nuget push ./azure.core.1.24.0.nupkg -Source http://10.20.1.78:8081/repository/package_nuget_for_portal/

Try adding -H "multipart/form-data" into Curl command:

curl -v -u admin:pwd -H "multipart/form-data" --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

Or use the Nuget command:

nuget sources add -u admin -p pwd -name myName -Source http://10.20.1.78:8081/repository/package_nuget_for_portal/
nuget push ./azure.core.1.24.0.nupkg -Source http://10.20.1.78:8081/repository/package_nuget_for_portal/
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文