Open titaniumbones opened 2 years ago
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.
Same requirement.
I tried to bind like this:
(let ((plz-curl-default-args
(append plz-curl-default-args
(list
"--form" "aaa=3"
"--form" "f=@~/aaa.jpg"))))
(plz 'post "https://httpbin.org/post"))
But error Failed to initialize
raised.
Maybe variable like plz-curl-default-config-args
can be added to pass extra config args.
But error
Failed to initialize
raised.
Probably because you passed a path containing ~
, which Curl probably doesn't expand itself; remember that a shell is not involved here, so ~
won't get expanded.
Probably because you passed a path containing
~
Same error when absolute path like /Users/xxx/aaa.jpg
is used.
Probably because you passed a path containing
~
Same error when absolute path like
/Users/xxx/aaa.jpg
is used.
Then it's probably due to argument order.
As I said on #62, if you need multipart/form-data support, please open an issue about it. And if you want to make a PR to support that, feel free.
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:
How would you feel about allowing an additional parameter
:additional-cli-args
(or something) that gets added tocurl-command-line-args
, or maybe just replacesplz-curl-default-args
? This would allow me to use plz for such requests. What do you think?