CRUD HTTP Methods with 🌀 CURL
Flags
-X= Request Method-X GET= Read data-X POST= Create data-X PUT= Update or replace data-X DELETE= Remove data-X PATCH= Partially update data-d= Sends data in the request body-d '{"name":"alex","role":"dev"}'-d "name=alex&role=dev"-F= Upload a file (multipart/form-data)-F "file=@report.pdf"-H= Add custom request headers-H "Content-Type: application/json"-H "Authorization: Bearer TOKEN"-H "X-Client-Version: 1.2.0"-v= Verbose (Show detailed request and response info)-L= Follow redirects (301 or 302 CODE)-C -= Resumes partial downloadcurl -O https://example.com/largefile.zip→ Start download- (If it fails midway...)
curl -C - -O https://example.com/largefile.zip→ Continue from where it stopped-u user:pass= Basic Auth
🔽 GET (READ)
📟 Terminal Output
💾 Download Files
Save with original filename
Save as a specific filename
➕ POST (CREATE)
curl -X POST https://api.example.com/developers \
-H "Content-Type: application/json" \
-d '{"name": "Alexander", "role": "DevOps"}'
✍️ PUT (UPDATE / REPLACE)
Replace data for user with ID 3
curl -X PUT \
-H "Content-Type: application/json" \
-d '{"email": "updated.email@example.com"}' \
https://crud.ba3a.tech/users/3
❌ DELETE
🔒 Upload a File with Token Auth
curl -X POST https://api.example.com/upload \
-H "Authorization: Bearer $TOKEN" \
-F "file=@report.pdf"
🕵️ Debugging
View only headers
Verbose output (full request/response)