Open podsvirov opened 10 months ago
The endpoint is /cargo/api/v1/crates/new
.
@KN4CK3R can you write example of usage like for debian
?
curl --user your_username:your_password_or_token \
--upload-file path/to/file.deb \
https://gitea.example.com/api/packages/testuser/debian/pool/bionic/main/upload
This endpoint intended to be called by cargo publish
but you can just send a PUT request with curl if you want to do that.
I'm trying type:
curl --user {user}:{password or token} --upload-file mypackage-0.1.0.crate \
https://gitea.example.com{xxx}/cargo/api/v1/crates/new
with diffirent {xxx} path variants (for example: empty, /{user}, /{organization}...) but allways get:
Not found.
UPDATE: Right path in https://gitea.example.com/{owner}/_cargo-index/config.json
.
UPDATE2: Now I'm learning Web API from The Cargo Book
.
curl --user {user}:{password or token} --upload-file mypackage-0.1.0.crate https://gitea.example.com/api/packages/{user}/cargo/api/v1/crates/new
curl --user {user}:{password or token} --upload-file mypackage-0.1.0.crate https://gitea.example.com/api/packages/{user}/cargo/api/v1/crates/new
Unfortunately It's not work, because:
The body of the data sent by Cargo is:
- 32-bit unsigned little-endian integer of the length of JSON data.
- Metadata of the package as a JSON object.
- 32-bit unsigned little-endian integer of the length of the .crate file.
- The .crate file.
Feature Description
As described in documentation, if I have
*.deb
package - I can upload it viaAPI
:I want similar api for
cargo
packages (*.crate
):Screenshots
No response