curl चीटशीट
API डिबगिंग और ऑटोमेशन के लिए HTTP क्लाइंट कमांड: मेथड्स, JSON पेलोड, हेडर, ऑथेंटिकेशन, मल्टीपार्ट अपलोड, कुकीज़, रीट्राय और curl 8.x पर TLS डायग्नोस्टिक्स।
यह कैसे काम करता है
curl transfers URL data from the shell: set method (-X), headers (-H), body (-d/-F), and output (-v/-i/-w) explicitly, because curl prints only the response body by default.
सर्वाइवल किट
वे कुछ कमांड जिन्हें सबसे पहले सीखना चाहिए।
42 कमांड
Requests & Methods
Send GET, HEAD, POST, PUT, PATCH, and DELETE requests with clean headers.
- आवश्यक
Fetch a URL and print the response body to stdout
curl <url>कमांड बनाएँ
curl <url>मान ठीक वैसे ही डाले जाते हैं जैसे टाइप किए गए हैं। यदि उनमें स्पेस या विशेष वर्ण हों तो स्वयं उद्धरण चिह्न लगाएँ।
इसका उपयोग कब करें
Baseline check for reachability, response payload, and pipe integration with jq.
उदाहरण
curl https://api.example.com/healthपरिणाम
{"status":"ok","version":"2.4.0"}
Payloads, Forms & Files
Send JSON, URL-encoded forms, multipart uploads, and binary bodies.
Auth, Cookies & TLS
Authenticate requests, manage cookies, resolve hosts, and verify certificates.
Headers, Timing & Debugging
Inspect TLS handshakes, response headers, status codes, and per-phase latency.
Downloads, Retries & Limits
Write files safely, resume interrupted downloads, cap wait time, and retry.