Curl curl (Client URL) is a command-line tool used for making HTTP requests Fast & lightweight, no GUI required like Postman Works on any system (Linux, macOS, Windows)
curl \
-k \
-H "ltpa-token: AAECAzYЗRDkyNzVDNjdEfPluGUv4DJ2tMh/LTdU+/ywA==" \
-H "Content-Type: application/json" \
https://local.domain.com:3010/public/administration/tt88001la2F00345
Arguments -X POST → Specify HTTP method (GET, POST, PUT, DELETE). Default is GET. -k → ignore SSL certificate validation -d "name=John" → Send data in a request (use with -X POST or -X PUT). -H "Authorization: Bearer YOUR_TOKEN" → Add request headers. -o response.json → Save response to a file. -s → Silent mode (hides progress and errors). -i → Include response headers in output. -v → Verbose mode (shows full request details). -L → Follow redirects automatically. -c cookies.txt → Save cookies. -b cookies.txt → Use saved cookies.
curl \
-X POST https://api.example.com/upload \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d @data.json \
-o response.json -v
Explanation
-X POST → Use the POST method.
-H "Authorization: Bearer YOUR_TOKEN" → Include an authentication token.
-H "Content-Type: application/json" → Specify JSON content type.
-d @data.json → Send JSON data from a file (@ means "read from file").
-o response.json → Save the response to response.json.
-v → Enable verbose mode to debug the request
Sending a JSON Payload with Variables
TOKEN="your_api_token"
USER_ID=123
curl -X PUT "https://api.example.com/users/$USER_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"active"}'