plz.el
plz.el copied to clipboard
Allow additional arguments to curl?
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?
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.
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.