cUrl cheatsheet
cUrl Cheatsheet
# download a file from a remote server and save it locally
curl -s -O https://raw.githubusercontent.com/danielmiessler/SecLists/56a39ab9a70a89b56d66dad8bdffb887fba1260e/Passwords/2023-200_most_used_passwords.txt
# Read entry
curl http://<SERVER_IP>:<PORT>/api.php/city/london
# Read all entries - add the "-s" flag to reduce cluttering the response with unnecessary data
curl -s http://<SERVER_IP>:<PORT>/api.php/city/ | jq
#Filter output with jq on a specific endpoint and value
curl -X 'GET' 'http://94.237.53.81:43876/api/v2/suppliers' -H 'accept: application/json'
| jq '.suppliers[] | select(.securityQuestion != "SupplierDidNotProvideYet")'
# Create (add) entry
curl -X POST http://<SERVER_IP>:<PORT>/api.php/city/ -d '{"city_name":"HTB_City", "country_name":"HTB"}' -H 'Content-Type: application/json'
# Update (modify) entry
curl -X PUT http://<SERVER_IP>:<PORT>/api.php/city/london -d '{"city_name":"New_HTB_City", "country_name":"HTB"}' -H 'Content-Type: application/json'
# Delete entry
curl -X DELETE http://<SERVER_IP>:<PORT>/api.php/city/New_HTB_CityCommand
Info
cUrl fo API
Last updated