Skip to content

feat(upload): Add HTTP method selection for upload - #2991

Merged
FabianLars merged 3 commits into
tauri-apps:v2from
velocitysystems:mrichardson/http_method
Nov 10, 2025
Merged

FabianLars merged 3 commits into
tauri-apps:v2from
velocitysystems:mrichardson/http_method

Conversation

@velocitysystems

@velocitysystems velocitysystems commented Sep 9, 2025 •

Copy link
Copy Markdown
Contributor

Resolves:
#2847

Key Changes

  • Support HTTP POST, PUT and PATCH methods
  • Update example page
  • Update tests
  • Bump version to 2.4.0
image

@FabianLars

Copy link
Copy Markdown
Member

Thanks for the PR! The main maintainers are out of office (or will be in the next 1-2 days) for the next 2-3 weeks so this may get delayed quite a bit.

P.S. Please revert the changes in Cargo.toml and package.json. Versioning will be handled in CI.

@velocitysystems

Copy link
Copy Markdown
Contributor Author

Thanks @FabianLars - Changes made, good to know versioning is handled by CI.
No urgency on this; it's been on my radar for a few weeks and wanted to get it done while I remember.

@github-actions

github-actions Bot commented Sep 9, 2025 •

Copy link
Copy Markdown
Contributor

Package Changes Through d2f099e

There are 6 changes which include log with minor, log-js with minor, updater with minor, updater-js with minor, upload with minor, upload-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.38 2.0.39
api-example-js 2.0.34 2.0.35
log 2.7.1 2.8.0
log-js 2.7.1 2.8.0
updater 2.9.0 2.10.0
updater-js 2.9.0 2.10.0
upload 2.3.2 2.4.0
upload-js 2.3.2 2.4.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars

Copy link
Copy Markdown
Member

what do you think about using https://docs.rs/http/1.3.1/http/method/struct.Method.html instead of a custom enum? It's already accessible via reqwest::Method or tauri::http::Method i think. (really asking for your opinion, not telling you what to do)

@velocitysystems

Copy link
Copy Markdown
Contributor Author

what do you think about using https://docs.rs/http/1.3.1/http/method/struct.Method.html instead of a custom enum? It's already accessible via reqwest::Method or tauri::http::Method i think. (really asking for your opinion, not telling you what to do)

@FabianLars Good question. Had a look and while we could use reqwest::Method it doesn't support the Deserialize trait. This means we'd need to deserialize the value as a string in Rust and then parse it using Method::from_str. While this would work we'd still need a corresponding enum in the Typescript API.

With this in mind it seems simpler/safer to just use a custom enum type in Rust. What do you think?

@velocitysystems

Copy link
Copy Markdown
Contributor Author

@FabianLars Rebased - All tests are passing locally.

@jiangjiji

Copy link
Copy Markdown

Very helpful

@FabianLars

Copy link
Copy Markdown
Member

With this in mind it seems simpler/safer to just use a custom enum type in Rust. What do you think?

I don't think there's much of a difference, but when i wrote my comment i thought the plugin had a rust api but since that's not true, i'm fine with your approach.

p.s. re-run pnpm build to fix CI

@velocitysystems

Copy link
Copy Markdown
Contributor Author

With this in mind it seems simpler/safer to just use a custom enum type in Rust. What do you think?

I don't think there's much of a difference, but when i wrote my comment i thought the plugin had a rust api but since that's not true, i'm fine with your approach.

p.s. re-run pnpm build to fix CI

Thanks @FabianLars. Just fixed CI build per your comments.

@FabianLars FabianLars left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@FabianLars
FabianLars merged commit ad910b1 into tauri-apps:v2 Nov 10, 2025
18 of 19 checks passed
@velocitysystems
velocitysystems deleted the mrichardson/http_method branch November 10, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants