Unix & Linux Asked by HDev007 on November 11, 2021
I have the following the curl command :-
curl --cert certificate_file.pem:password -i -X POST -H 'Content-Type:application/json' -d '{somedata}'
below part of curl would be common
curl –cert certificate_file.pem:password
How can I make it reusable and call?
You can even use an alias for that, since the first part remains constant.
alias mycurl='curl --cert certificate_file.pem:password'
If you insist on a function, this could work:
function mycurl()
{
curl --cert certificate_file.pem:password "$@"
}
Both can now be invoked this way:
mycurl -i -X POST -H 'Content-Type:application/json' -d '{somedata}'
Answered by Artem S. Tashkinov on November 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP