cURL चीट शीट
खोजने और प्रिंट करने योग्य curl संदर्भ — HTTP मेथड, हेडर, डेटा और फ़ॉर्म, ऑथ, डाउनलोड, कुकीज़, TLS, प्रॉक्सी और डिबगिंग। निःशुल्क।
मूल बातें
12curl https://api.example.com
GET अनुरोध भेजें और body प्रिंट करें
curl -o page.html https://example.com
प्रतिक्रिया को नामित फ़ाइल में सहेजें
curl -O https://example.com/file.zip
रिमोट फ़ाइल नाम से सहेजें
curl -i https://example.com
प्रतिक्रिया header और body दिखाएं
curl -I https://example.com
केवल प्रतिक्रिया header लाएं (HEAD)
curl -v https://example.com
अनुरोध/प्रतिक्रिया का विस्तृत आउटपुट
curl -s https://example.com
Silent मोड, प्रगति और त्रुटियां छिपाएं
curl -sS https://example.com
Silent पर त्रुटियां फिर भी दिखाएं
curl -L https://example.com
HTTP redirect का अनुसरण करें (3xx)
curl https://a.com https://b.com
एक कॉल में कई URL अनुरोध करें
curl 'https://x.com/p?[1-5]'
URL लूप करने संख्यात्मक रेंज का उपयोग करें
curl --version
curl संस्करण और विशेषताएं प्रिंट करें
HTTP तरीके
9curl -X GET https://api.example.com
स्पष्ट रूप से GET अनुरोध भेजें
curl -X POST https://api.example.com
POST अनुरोध भेजें
curl -X PUT https://api.example.com/1
संसाधन बदलने PUT अनुरोध भेजें
curl -X PATCH https://api.example.com/1
फ़ील्ड अपडेट करने PATCH अनुरोध भेजें
curl -X DELETE https://api.example.com/1
DELETE अनुरोध भेजें
curl -I https://api.example.com
केवल header के लिए HEAD अनुरोध भेजें
curl -X OPTIONS https://api.example.com
OPTIONS preflight अनुरोध भेजें
curl --head https://api.example.com
HEAD अनुरोध हेतु -I का लंबा रूप
curl --request POST https://x.com
method सेट करने -X का लंबा रूप
हेडर
10curl -H 'Accept: application/json' https://x.com
एक अनुरोध header जोड़ें
curl -H 'X-Token: abc' -H 'X-Env: dev' https://x.com
कई header जोड़ें
curl -H 'Content-Type: application/json' https://x.com
अनुरोध body content type घोषित करें
curl -H 'Authorization: Bearer TOKEN' https://x.com
bearer authorization header भेजें
curl -H 'Host: example.com' https://1.2.3.4
Host header ओवरराइड करें
curl -H 'Accept-Encoding: gzip' https://x.com
gzip-संपीड़ित प्रतिक्रिया अनुरोध करें
curl -A 'MyAgent/1.0' https://x.com
User-Agent स्ट्रिंग सेट करें
curl -e 'https://ref.com' https://x.com
Referer header सेट करें
curl -H 'X-Debug:' https://x.com
इसे खाली छोड़कर डिफ़ॉल्ट header हटाएं
curl --compressed https://x.com
प्रतिक्रिया मांगें और स्वतः decompress करें
डेटा भेजना
11curl -d 'name=Jane&age=30' https://x.com
URL-encoded फ़ॉर्म डेटा POST करें
curl -d '@payload.json' https://x.com
फ़ाइल से पढ़ा डेटा POST करें
curl --data-urlencode 'q=hello world' https://x.com
एक URL-encoded फ़ील्ड POST करें
curl --data-binary '@file.bin' https://x.com
बिना प्रोसेसिंग raw bytes POST करें
curl -G --data-urlencode 'q=cats' https://x.com
डेटा को GET query string के रूप में जोड़ें
curl -X POST -H 'Content-Type: application/json' -d '{"name":"Jane"}' https://x.com
JSON body POST करें
curl --json '{"name":"Jane"}' https://x.com
JSON POST करें और JSON header स्वतः सेट करें
curl -F 'name=Jane' https://x.com
multipart फ़ॉर्म फ़ील्ड भेजें
curl -F 'file=@photo.png' https://x.com
फ़ाइल को multipart form-data के रूप में अपलोड करें
curl -F 'file=@a.pdf;type=application/pdf' https://x.com
स्पष्ट MIME type के साथ फ़ाइल अपलोड करें
curl -d '' https://x.com
खाली body के साथ POST करें
प्रमाणीकरण
9curl -u user:pass https://x.com
HTTP basic प्रमाणीकरण
curl -u user https://x.com
Basic auth, पासवर्ड के लिए संकेत दें
curl -H 'Authorization: Bearer TOKEN' https://x.com
bearer token header भेजें
curl --oauth2-bearer TOKEN https://x.com
OAuth 2.0 bearer token भेजें
curl --digest -u user:pass https://x.com
HTTP digest प्रमाणीकरण उपयोग करें
curl --ntlm -u user:pass https://x.com
NTLM प्रमाणीकरण उपयोग करें
curl --netrc https://x.com
~/.netrc से क्रेडेंशियल पढ़ें
curl --netrc-file creds https://x.com
कस्टम netrc फ़ाइल से क्रेडेंशियल पढ़ें
curl -H 'X-Api-Key: KEY' https://x.com
API key header भेजें
डाउनलोडिंग और अपलोडिंग
11curl -O https://x.com/file.zip
रिमोट फ़ाइल नाम से डाउनलोड करें
curl -o out.zip https://x.com/file.zip
चुने गए फ़ाइल नाम में डाउनलोड करें
curl -OL https://x.com/file.zip
डाउनलोड करें और redirect का अनुसरण करें
curl -C - -O https://x.com/file.zip
अधूरा डाउनलोड फिर से शुरू करें
curl --limit-rate 200k -O https://x.com/f
स्थानांतरण गति सीमित करें
curl -r 0-1023 -o part https://x.com/f
केवल byte रेंज डाउनलोड करें
curl --retry 3 -O https://x.com/f
विफलता पर डाउनलोड पुनः प्रयास करें
curl -T file.txt ftp://x.com/
PUT/FTP से फ़ाइल अपलोड करें
curl -T file.txt https://x.com/up
HTTP PUT से फ़ाइल अपलोड करें
curl --create-dirs -o a/b/f.txt https://x.com
आउटपुट हेतु अनुपस्थित डायरेक्टरी बनाएं
curl -# -O https://x.com/file.zip
एक सरल प्रगति बार दिखाएं
Cookies
8curl -b 'session=abc123' https://x.com
इनलाइन cookie भेजें
curl -b cookies.txt https://x.com
फ़ाइल से cookies भेजें
curl -c cookies.txt https://x.com
प्राप्त cookies को jar में लिखें
curl -b jar.txt -c jar.txt https://x.com
एक ही cookie jar पढ़ें और अपडेट करें
curl -b 'a=1; b=2' https://x.com
एक साथ कई cookies भेजें
curl -c - https://x.com
प्राप्त cookies stdout पर प्रिंट करें
curl --junk-session-cookies -b jar.txt https://x.com
jar से session cookies अनदेखा करें
curl -L -c jar.txt -b jar.txt https://x.com/login
redirect भर में session बनाए रखें
TLS / SSL
10curl -k https://x.com
असुरक्षित अनुमति दें (cert सत्यापन छोड़ें)
curl --cacert ca.pem https://x.com
कस्टम CA bundle से सत्यापित करें
curl --capath /etc/ssl/certs https://x.com
CA प्रमाणपत्रों की डायरेक्टरी उपयोग करें
curl --cert client.pem https://x.com
client प्रमाणपत्र भेजें
curl --cert client.pem --key client.key https://x.com
client cert और private key उपयोग करें
curl --tlsv1.2 https://x.com
कम से कम TLS 1.2 आवश्यक करें
curl --tlsv1.3 https://x.com
कम से कम TLS 1.3 आवश्यक करें
curl --tls-max 1.2 https://x.com
अधिकतम TLS संस्करण सीमित करें
curl --ciphers ECDHE-RSA-AES128-GCM-SHA256 https://x.com
अनुमत TLS cipher प्रतिबंधित करें
curl -vI https://x.com
TLS handshake विवरण निरीक्षण करें
Proxies
9curl -x http://proxy:8080 https://x.com
अनुरोध को HTTP proxy से रूट करें
curl --proxy http://proxy:8080 https://x.com
proxy सेट करने -x का लंबा रूप
curl -x proxy:8080 -U user:pass https://x.com
proxy के लिए प्रमाणित करें
curl --proxy-user user:pass -x proxy:8080 https://x.com
proxy क्रेडेंशियल का लंबा रूप
curl --socks5 127.0.0.1:1080 https://x.com
SOCKS5 proxy उपयोग करें
curl --socks5-hostname 127.0.0.1:1080 https://x.com
रिमोट DNS resolution के साथ SOCKS5 proxy
curl --socks4 127.0.0.1:1080 https://x.com
SOCKS4 proxy उपयोग करें
curl --noproxy example.com https://x.com
दिए गए होस्ट के लिए proxy बायपास करें
curl -x '' https://x.com
किसी भी कॉन्फ़िगर proxy को अक्षम करें
डिबगिंग और आउटपुट
11curl -w '%{http_code}\n' -o /dev/null -s https://x.com
केवल HTTP स्थिति कोड प्रिंट करें
curl -w '%{time_total}\n' -o /dev/null -s https://x.com
कुल स्थानांतरण समय प्रिंट करें
curl -w '@format.txt' https://x.com
फ़ाइल से write-out प्रारूप पढ़ें
curl -D headers.txt https://x.com
प्रतिक्रिया header फ़ाइल में डंप करें
curl -D - -o body.txt https://x.com
header stdout पर, body फ़ाइल में
curl --trace trace.txt https://x.com
स्थानांतरण का पूर्ण hex trace
curl --trace-ascii - https://x.com
stdout पर ASCII trace
curl --trace-time -v https://x.com
विस्तृत आउटपुट में timestamp जोड़ें
curl -v https://x.com 2>&1 | less
विस्तृत लॉग को पेज करके देखें
curl -sS -o /dev/null -w '%{size_download}\n' https://x.com
डाउनलोड किया byte गणना प्रिंट करें
curl --libcurl out.c https://x.com
समतुल्य libcurl C स्रोत उत्सर्जित करें
टाइमआउट और पुनः प्रयास
10curl --connect-timeout 5 https://x.com
कनेक्शन चरण को सेकंड में सीमित करें
curl --max-time 30 https://x.com
पूरे ऑपरेशन समय को सीमित करें
curl --retry 3 https://x.com
क्षणिक त्रुटियों पर पुनः प्रयास करें
curl --retry 3 --retry-delay 2 https://x.com
पुनः प्रयासों के बीच प्रतीक्षा करें
curl --retry 5 --retry-max-time 60 https://x.com
पुनः प्रयास में बीते कुल समय को सीमित करें
curl --retry-connrefused https://x.com
connection refused पर भी पुनः प्रयास करें
curl --retry-all-errors https://x.com
किसी भी त्रुटि पर पुनः प्रयास करें, केवल क्षणिक नहीं
curl --speed-limit 100 --speed-time 10 https://x.com
अवधि भर बहुत धीमा होने पर रद्द करें
curl --keepalive-time 60 https://x.com
TCP keep-alive अंतराल सेट करें
curl --expect100-timeout 1 https://x.com
100-continue की प्रतीक्षा सीमित करें
कोई प्रविष्टि “:q” से मेल नहीं खाती।
मदद चाहिए?
इस टूल में कोई समस्या मिली? हमारी टीम को बताएं।