curl

2025.03.23

xxx

#terminal
use client /components/post/reExport , date: , tags: [ ], imgUrl: , desc: , body: ( <> <H>Curl</H> <ul> <li> <code>curl</code> (Client URL) is a command-line tool used for making HTTP requests </li> <li>Fast & lightweight, no GUI required like Postman</li> <li>Works on any system (Linux, macOS, Windows)</li> </ul> <Code block bash>{ ltpa-token: AAECAzYЗRDkyNzVDNjdEfPluGUv4DJ2tMh/LTdU+/ywA== Content-Type: application/json }</Code> <Code block bash>{ cookie: LtpaToken=AAECAzY4NjRENzk0Njg2NTY0MzRDTj1BbnRvbjEgQXJidXMvTz1IZWVyb3OXI0hnSP7XOjg5aOG3AO4JKvm+iQ== Content-Type: application/json https://api.dev.heeros.com/anton-windmill-service-v1/automation-rule?tt=00001&la=00001 }</Code> <H>Arguments</H> <ul> <li> <code>-X POST</code> → Specify HTTP method (GET, POST, PUT, DELETE). Default is GET. </li> <li> <code>-k</code> → ignore SSL certificate validation </li> <li> <code>-d </code> → Send data in a request (use with -X POST or -X PUT). </li> <li> <code>-H </code> → Add request headers. </li> <li> <code>-o response.json</code> → Save response to a file. </li> <li> <code>-s</code> → Silent mode (hides progress and errors). </li> <li> <code>-i</code> → Include response headers in output. </li> <li> <code>-v</code> → Verbose mode (shows full request details). </li> <li> <code>-L</code> → Follow redirects automatically. </li> <li> <code>-c cookies.txt</code> → Save cookies. </li> <li> <code>-b cookies.txt</code> → Use saved cookies. </li> <li> <code>curl ... | jq</code> → Nice json format </li> </ul> <Code block jsx>{ Authorization: Bearer YOUR_TOKEN Content-Type: application/json Authorization: Bearer YOUR_TOKEN Content-Type: application/json read from file }</Code> <H>Sending a JSON Payload with Variables</H> <Code block jsx>{ your_api_token https://api.example.com/users/$USER_ID Authorization: Bearer $TOKEN Content-Type: application/json