Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(upload): Added body to download function #1523

Open
wants to merge 7 commits into
base: v2
Choose a base branch
from

Conversation

enri90
Copy link

@enri90 enri90 commented Jul 6, 2024

Added post functionality to the download function
Example

const body = JSON.stringify({ ids: ids });

await download(
  url,
  path,
  ({ progress, total }) => console.log(`Downloaded ${progress} of ${total} bytes`),
  new Map<string, string>([
    ['Content-Type', 'application/json'],
  ]),
  body
);

@enri90 enri90 requested a review from a team as a code owner July 6, 2024 12:53
@FabianLars
Copy link
Member

Sorry for the long delay in your first PR. What do you think about leveraging the native Request object for the url and body?

Basically mirroring the http plugin: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/http/guest-js/index.ts#L104

Let me know what you think and whether you'd be open to work on it (if you agree) or if i should take over :)

@enri90
Copy link
Author

enri90 commented Jul 9, 2024

Sorry for the long delay in your first PR. What do you think about leveraging the native Request object for the url and body?

Basically mirroring the http plugin: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/http/guest-js/index.ts#L104

Let me know what you think and whether you'd be open to work on it (if you agree) or if i should take over :)

Hi! Thank you for the feedback.
I understand the request to leverage the native Request object for the URL and body and think it's a good idea.
However, I'm not very familiar with Rust and am not sure how to implement this.
If you could take over this part, that would be fantastic.
Thanks!

@FabianLars
Copy link
Member

Okay sure, no problem!

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.

2 participants