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

ability to return binary data to frontend #1430

Closed
AnupamKris opened this issue Jul 6, 2024 · 5 comments
Closed

ability to return binary data to frontend #1430

AnupamKris opened this issue Jul 6, 2024 · 5 comments
Labels

Comments

@AnupamKris
Copy link

Specification

  • pywebview version: 5.1
  • operating system: Ubuntu 24.04
  • web renderer: Gtk

Description

Is it possible to return a binary data as such to frontend rather than converting it into a string and parsing in js?

Practicalities

  • NO - I am willing to work on this issue myself.

  • NO - I am prepared to support this issue financially.

@r0x0r
Copy link
Owner

r0x0r commented Jul 10, 2024

You may serve binary data using a custom http server.
Data passed between frontend and backend using js api is serialised using JSON. Encoding binary as base64 or such is one option, but it is probably not suitable for serving large amounts of data.

@AnupamKris
Copy link
Author

But can I use the custom http server the same way as exposing functions or should I use fetch or axios to use it?

@r0x0r
Copy link
Owner

r0x0r commented Jul 31, 2024

You can use js api with an external http server, but you would need to fetch binary data exposed by http server using rest api.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 31, 2024
Copy link

github-actions bot commented Sep 5, 2024

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.

@github-actions github-actions bot closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants