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

Support File as Request Body #352

Open
animator opened this issue Mar 23, 2024 · 6 comments · May be fixed by #354
Open

Support File as Request Body #352

animator opened this issue Mar 23, 2024 · 6 comments · May be fixed by #354
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@animator
Copy link
Member

animator commented Mar 23, 2024

Tell us about the task you want to perform and are unable to do so because the feature is not available
Currently API Dash supports text, json, multipart formdata as request body.
Support should also be provided to attach just a single file.
The contents of the file is sent as bytes and the content-type is application/octet-stream

Example API use case - Send an image in request body and obtain its base64 string form as response.

@animator animator added the enhancement New feature or request label Mar 23, 2024
@animator animator added the good first issue Good for newcomers label Mar 23, 2024
@AcousticDeveloper
Copy link
Contributor

AcousticDeveloper commented Mar 24, 2024

Shall we add one more tab like section named File Upload beside the existing three with a drag and drop interface or for the initial setup, the existing select file is preferred?

image

@Tanish2002
Copy link
Contributor

@animator would this include rewriting all codegens and their corresponding tests as well?

Also, I believe I would have to add a new state variable to class RequestModel to store the file name, I can't simply use requestBody since it's shared by json and text type requests and when switching between them, it would conflict.

@Tanish2002 Tanish2002 linked a pull request Mar 24, 2024 that will close this issue
4 tasks
@alainjr10
Copy link
Contributor

Has anyone noticed file picker not working on linux? I don't know if i should raise a new issue or maybe my environment isn't properly configured.
The pick file method returns null

@Tanish2002
Copy link
Contributor

Tanish2002 commented Mar 24, 2024

Has anyone noticed file picker not working on linux? I don't know if i should raise a new issue or maybe my environment isn't properly configured. The pick file method returns null

@alainjr10 Yeah this isn't documented but on linux you need zenity installed to make it work correctly.

@animator I believe the mpv and zenity dependency should be documented for linux developers

Edit: Link to the package on repology: https://repology.org/project/zenity/versions

Edit 2: it needs one of the following qarma, kdialog, zenity:
source: https://github.com/miguelpruivo/flutter_file_picker/blob/04e32daa8180e4d93a96c1d0ffba9d61feb25b10/lib/src/linux/file_picker_linux.dart#L108

@alainjr10
Copy link
Contributor

Has anyone noticed file picker not working on linux? I don't know if i should raise a new issue or maybe my environment isn't properly configured. The pick file method returns null

@alainjr10 Yeah this isn't documented but on linux you need zenity installed to make it work correctly.

@animator I believe the mpv and zenity dependency should be documented for linux developers

Edit: Link to the package on repology: https://repology.org/project/zenity/versions

Edit 2: it needs one of the following qarma, kdialog, zenity:
source: https://github.com/miguelpruivo/flutter_file_picker/blob/04e32daa8180e4d93a96c1d0ffba9d61feb25b10/lib/src/linux/file_picker_linux.dart#L108

Thanks a lot @Tanish2002 .
I been stuck on this issue since yesterday.
I'll try it and give you feedback.

@Tanish2002
Copy link
Contributor

FWIW, I've opened a PR to potentially fix this issue #357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants