Karatasi ya Marejeleo ya cURL
Marejeleo ya curl yanayoweza kutafutwa na kuchapishwa — mbinu za HTTP, vichwa, data na fomu, uthibitishaji, vipakuliwa, cookies, TLS, proksi na utatuzi. Bila malipo.
Misingi
12curl https://api.example.com
Tuma ombi la GET na uchapishe mwili
curl -o page.html https://example.com
Hifadhi jibu kwenye faili lenye jina
curl -O https://example.com/file.zip
Hifadhi ukitumia jina la faili la mbali
curl -i https://example.com
Onyesha headers za jibu pamoja na mwili
curl -I https://example.com
Fetch headers za jibu pekee (HEAD)
curl -v https://example.com
Matokeo ya kina ya ombi/jibu
curl -s https://example.com
Hali ya kimya, ficha maendeleo na makosa
curl -sS https://example.com
Kimya lakini bado onyesha makosa
curl -L https://example.com
Fuata redirects za HTTP (3xx)
curl https://a.com https://b.com
Omba URLs nyingi kwa mwito mmoja
curl 'https://x.com/p?[1-5]'
Tumia fungu la nambari kuzungukia URLs
curl --version
Chapisha toleo na vipengele vya curl
Mbinu za HTTP
9curl -X GET https://api.example.com
Tuma ombi la GET kwa uwazi
curl -X POST https://api.example.com
Tuma ombi la POST
curl -X PUT https://api.example.com/1
Tuma ombi la PUT kubadilisha rasilimali
curl -X PATCH https://api.example.com/1
Tuma ombi la PATCH kusasisha sehemu
curl -X DELETE https://api.example.com/1
Tuma ombi la DELETE
curl -I https://api.example.com
Tuma ombi la HEAD kwa headers pekee
curl -X OPTIONS https://api.example.com
Tuma ombi la preflight la OPTIONS
curl --head https://api.example.com
Umbo refu la -I kwa ombi la HEAD
curl --request POST https://x.com
Umbo refu la -X kuweka mbinu
Headers
10curl -H 'Accept: application/json' https://x.com
Ongeza header moja ya ombi
curl -H 'X-Token: abc' -H 'X-Env: dev' https://x.com
Ongeza headers nyingi
curl -H 'Content-Type: application/json' https://x.com
Tangaza aina ya yaliyomo ya mwili wa ombi
curl -H 'Authorization: Bearer TOKEN' https://x.com
Tuma header ya idhini ya bearer
curl -H 'Host: example.com' https://1.2.3.4
Batilisha header ya Host
curl -H 'Accept-Encoding: gzip' https://x.com
Omba jibu lililobanwa kwa gzip
curl -A 'MyAgent/1.0' https://x.com
Weka string ya User-Agent
curl -e 'https://ref.com' https://x.com
Weka header ya Referer
curl -H 'X-Debug:' https://x.com
Ondoa header chaguo-msingi kwa kuiacha tupu
curl --compressed https://x.com
Omba na ufungue jibu kiotomatiki
Kutuma data
11curl -d 'name=Jane&age=30' https://x.com
POST data ya fomu iliyo encoded kwa URL
curl -d '@payload.json' https://x.com
POST data iliyosomwa kutoka faili
curl --data-urlencode 'q=hello world' https://x.com
POST sehemu moja iliyo encoded kwa URL
curl --data-binary '@file.bin' https://x.com
POST baiti ghafi bila kuchakata
curl -G --data-urlencode 'q=cats' https://x.com
Ambatisha data kama query string ya GET
curl -X POST -H 'Content-Type: application/json' -d '{"name":"Jane"}' https://x.com
POST mwili wa JSON
curl --json '{"name":"Jane"}' https://x.com
POST JSON na uweke headers za JSON kiotomatiki
curl -F 'name=Jane' https://x.com
Tuma sehemu ya fomu ya multipart
curl -F 'file=@photo.png' https://x.com
Pakia faili kama form-data ya multipart
curl -F 'file=@a.pdf;type=application/pdf' https://x.com
Pakia faili na aina ya MIME ya wazi
curl -d '' https://x.com
POST na mwili tupu
Uthibitishaji
9curl -u user:pass https://x.com
Uthibitishaji wa msingi wa HTTP
curl -u user https://x.com
Uthibitishaji wa msingi, uliza nenosiri
curl -H 'Authorization: Bearer TOKEN' https://x.com
Tuma header ya token ya bearer
curl --oauth2-bearer TOKEN https://x.com
Tuma token ya bearer ya OAuth 2.0
curl --digest -u user:pass https://x.com
Tumia uthibitishaji wa digest wa HTTP
curl --ntlm -u user:pass https://x.com
Tumia uthibitishaji wa NTLM
curl --netrc https://x.com
Soma kitambulisho kutoka ~/.netrc
curl --netrc-file creds https://x.com
Soma kitambulisho kutoka faili maalum la netrc
curl -H 'X-Api-Key: KEY' https://x.com
Tuma header ya ufunguo wa API
Kupakua na kupakia
11curl -O https://x.com/file.zip
Pakua ukitumia jina la faili la mbali
curl -o out.zip https://x.com/file.zip
Pakua kwenye jina la faili lililochaguliwa
curl -OL https://x.com/file.zip
Pakua na ufuate redirects
curl -C - -O https://x.com/file.zip
Endelea upakuaji usiokamilika
curl --limit-rate 200k -O https://x.com/f
Weka kikomo cha kasi ya uhamishaji
curl -r 0-1023 -o part https://x.com/f
Pakua fungu la baiti pekee
curl --retry 3 -O https://x.com/f
Jaribu tena upakuaji ukishindwa
curl -T file.txt ftp://x.com/
Pakia faili kwa PUT/FTP
curl -T file.txt https://x.com/up
Pakia faili kupitia HTTP PUT
curl --create-dirs -o a/b/f.txt https://x.com
Tengeneza saraka zinazokosekana kwa matokeo
curl -# -O https://x.com/file.zip
Onyesha upau rahisi wa maendeleo
Cookies
8curl -b 'session=abc123' https://x.com
Tuma cookie inline
curl -b cookies.txt https://x.com
Tuma cookies kutoka faili
curl -c cookies.txt https://x.com
Andika cookies zilizopokelewa kwenye jar
curl -b jar.txt -c jar.txt https://x.com
Soma na sasisha cookie jar moja
curl -b 'a=1; b=2' https://x.com
Tuma cookies nyingi kwa pamoja
curl -c - https://x.com
Chapisha cookies zilizopokelewa kwenye stdout
curl --junk-session-cookies -b jar.txt https://x.com
Puuza session cookies kutoka jar
curl -L -c jar.txt -b jar.txt https://x.com/login
Hifadhi kipindi kupitia redirects
TLS / SSL
10curl -k https://x.com
Ruhusu isiyo salama (ruka uthibitishaji wa cheti)
curl --cacert ca.pem https://x.com
Thibitisha kwa kifurushi maalum cha CA
curl --capath /etc/ssl/certs https://x.com
Tumia saraka ya vyeti vya CA
curl --cert client.pem https://x.com
Tuma cheti cha mteja
curl --cert client.pem --key client.key https://x.com
Tumia cheti cha mteja na ufunguo wa faragha
curl --tlsv1.2 https://x.com
Hitaji angalau TLS 1.2
curl --tlsv1.3 https://x.com
Hitaji angalau TLS 1.3
curl --tls-max 1.2 https://x.com
Weka kikomo cha toleo la juu la TLS
curl --ciphers ECDHE-RSA-AES128-GCM-SHA256 https://x.com
Zuia ciphers za TLS zinazoruhusiwa
curl -vI https://x.com
Kagua maelezo ya handshake ya TLS
Proxies
9curl -x http://proxy:8080 https://x.com
Pitisha ombi kupitia proxy ya HTTP
curl --proxy http://proxy:8080 https://x.com
Umbo refu la -x kuweka proxy
curl -x proxy:8080 -U user:pass https://x.com
Jithibitishe kwa proxy
curl --proxy-user user:pass -x proxy:8080 https://x.com
Umbo refu la kitambulisho cha proxy
curl --socks5 127.0.0.1:1080 https://x.com
Tumia proxy ya SOCKS5
curl --socks5-hostname 127.0.0.1:1080 https://x.com
Proxy ya SOCKS5 na utatuzi wa DNS wa mbali
curl --socks4 127.0.0.1:1080 https://x.com
Tumia proxy ya SOCKS4
curl --noproxy example.com https://x.com
Pita proxy kwa hosts zilizopewa
curl -x '' https://x.com
Zima proxy yoyote iliyosanidiwa
Kurekebisha na matokeo
11curl -w '%{http_code}\n' -o /dev/null -s https://x.com
Chapisha code ya hali ya HTTP pekee
curl -w '%{time_total}\n' -o /dev/null -s https://x.com
Chapisha muda jumla wa uhamishaji
curl -w '@format.txt' https://x.com
Soma muundo wa write-out kutoka faili
curl -D headers.txt https://x.com
Tupa headers za jibu kwenye faili
curl -D - -o body.txt https://x.com
Headers kwenye stdout, mwili kwenye faili
curl --trace trace.txt https://x.com
Trace kamili ya hex ya uhamishaji
curl --trace-ascii - https://x.com
Trace ya ASCII kwenye stdout
curl --trace-time -v https://x.com
Ongeza timestamps kwenye matokeo ya kina
curl -v https://x.com 2>&1 | less
Pitia log ya kina ukurasa kwa ukurasa
curl -sS -o /dev/null -w '%{size_download}\n' https://x.com
Chapisha hesabu ya baiti zilizopakuliwa
curl --libcurl out.c https://x.com
Toa msimbo wa C wa libcurl sawia
Timeouts na majaribio upya
10curl --connect-timeout 5 https://x.com
Weka kikomo cha awamu ya muunganisho kwa sekunde
curl --max-time 30 https://x.com
Weka kikomo cha muda wa operesheni nzima
curl --retry 3 https://x.com
Jaribu tena kwenye makosa ya muda
curl --retry 3 --retry-delay 2 https://x.com
Subiri kati ya majaribio upya
curl --retry 5 --retry-max-time 60 https://x.com
Weka kikomo cha muda jumla wa kujaribu upya
curl --retry-connrefused https://x.com
Pia jaribu tena muunganisho ukikataliwa
curl --retry-all-errors https://x.com
Jaribu tena kwenye kosa lolote, si la muda tu
curl --speed-limit 100 --speed-time 10 https://x.com
Sitisha ikiwa polepole mno kwa muda
curl --keepalive-time 60 https://x.com
Weka muda wa keep-alive wa TCP
curl --expect100-timeout 1 https://x.com
Weka kikomo cha kusubiri 100-continue
Hakuna kipengele kinacholingana na “:q”.
Unahitaji msaada?
Umepata tatizo na zana hii? Tujulishe timu yetu.