plz.el icon indicating copy to clipboard operation
plz.el copied to clipboard

Allow additional arguments to curl?

Open titaniumbones opened this issue 3 years ago • 6 comments

I'd like to use plz to upload files to an authorized endpoint. That endpoint requires the file and various dynamically-assigned parameters to be passed as multipart form data. In curl this is achieved with command-line arguments like:

curl '<upload_url>' \
     -F 'key=/users/1234/files/profile_pic.jpg' \
     <any other parameters specified in the upload_params response>
     -F 'file=@my_local_file.jpg'

How would you feel about allowing an additional parameter :additional-cli-args (or something) that gets added to curl-command-line-args, or maybe just replaces plz-curl-default-args? This would allow me to use plz for such requests. What do you think?

titaniumbones avatar Nov 04 '21 01:11 titaniumbones

Hi Matt,

We could add such a variable if necessary, but I think you can just bind plz-curl-default-args to whatever value you need before calling plz to accomplish the same thing. AFAIK it should work, unless there's some kind of conflict in argument order. Please try it and let me know if it works.

alphapapa avatar Nov 27 '21 18:11 alphapapa

By the way, for the use case you present, ideally there would be no need for the user to specify additional arguments for curl--rather, it should all be doable with plz's own API. So if you'd like, we could talk further about how to implement that according to your needs.

alphapapa avatar Dec 31 '22 22:12 alphapapa