apidash icon indicating copy to clipboard operation
apidash copied to clipboard

Support File as Request Body

Open animator opened this issue 1 year ago • 6 comments

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 avatar Mar 23 '24 13:03 animator

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

AcousticDeveloper avatar Mar 24 '24 07:03 AcousticDeveloper

@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 avatar Mar 24 '24 09:03 Tanish2002

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 avatar Mar 24 '24 12:03 alainjr10

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

Tanish2002 avatar Mar 24 '24 14:03 Tanish2002

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.

alainjr10 avatar Mar 24 '24 15:03 alainjr10

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

Tanish2002 avatar Mar 24 '24 15:03 Tanish2002