12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496 |
- _ _ ____ _
- ___| | | | _ \| |
- / __| | | | |_) | |
- | (__| |_| | _ <| |___
- \___|\___/|_| \_\_____|
- FAQ
- 1. Philosophy
- 1.1 What is cURL?
- 1.2 What is libcurl?
- 1.3 What is curl not?
- 1.4 When will you make curl do XXXX ?
- 1.5 Who makes curl?
- 1.6 What do you get for making curl?
- 1.7 What about CURL from curl.com?
- 1.8 I have a problem who do I mail?
- 1.9 Where do I buy commercial support for curl?
- 1.10 How many are using curl?
- 1.11 Why don't you update ca-bundle.crt
- 1.12 I have a problem who can I chat with?
- 1.13 curl's ECCN number?
- 1.14 How do I submit my patch?
- 2. Install Related Problems
- 2.1 configure doesn't find OpenSSL even when it is installed
- 2.1.1 native linker doesn't find OpenSSL
- 2.1.2 only the libssl lib is missing
- 2.2 Does curl work/build with other SSL libraries?
- 2.3 Where can I find a copy of LIBEAY32.DLL?
- 2.4 Does curl support SOCKS (RFC 1928) ?
- 3. Usage Problems
- 3.1 curl: (1) SSL is disabled, https: not supported
- 3.2 How do I tell curl to resume a transfer?
- 3.3 Why doesn't my posting using -F work?
- 3.4 How do I tell curl to run custom FTP commands?
- 3.5 How can I disable the Accept: */* header?
- 3.6 Does curl support ASP, XML, XHTML or HTML version Y?
- 3.7 Can I use curl to delete/rename a file through FTP?
- 3.8 How do I tell curl to follow HTTP redirects?
- 3.9 How do I use curl in my favorite programming language?
- 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP?
- 3.11 How do I POST with a different Content-Type?
- 3.12 Why do FTP specific features over HTTP proxy fail?
- 3.13 Why does my single/double quotes fail?
- 3.14 Does curl support Javascript or PAC (automated proxy config)?
- 3.15 Can I do recursive fetches with curl?
- 3.16 What certificates do I need when I use SSL?
- 3.17 How do I list the root dir of an FTP server?
- 3.18 Can I use curl to send a POST/PUT and not wait for a response?
- 3.19 How do I get HTTP from a host using a specific IP address?
- 3.20 How to SFTP from my user's home directory?
- 3.21 Protocol xxx not supported or disabled in libcurl
- 3.22 curl -X gives me HTTP problems
- 4. Running Problems
- 4.1 Problems connecting to SSL servers.
- 4.2 Why do I get problems when I use & or % in the URL?
- 4.3 How can I use {, }, [ or ] to specify multiple URLs?
- 4.4 Why do I get downloaded data even though the web page doesn't exist?
- 4.5 Why do I get return code XXX from a HTTP server?
- 4.5.1 "400 Bad Request"
- 4.5.2 "401 Unauthorized"
- 4.5.3 "403 Forbidden"
- 4.5.4 "404 Not Found"
- 4.5.5 "405 Method Not Allowed"
- 4.5.6 "301 Moved Permanently"
- 4.6 Can you tell me what error code 142 means?
- 4.7 How do I keep user names and passwords secret in Curl command lines?
- 4.8 I found a bug!
- 4.9 Curl can't authenticate to the server that requires NTLM?
- 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work!
- 4.11 Why does my HTTP range requests return the full document?
- 4.12 Why do I get "certificate verify failed" ?
- 4.13 Why is curl -R on Windows one hour off?
- 4.14 Redirects work in browser but not with curl!
- 4.15 FTPS doesn't work
- 4.16 My HTTP POST or PUT requests are slow
- ~(){}<>\|;`. When in doubt, quote the URL.
- An example that would invoke a remote CGI that uses &-symbols could be:
- curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
- In Windows, the standard DOS shell treats the percent sign specially and you
- need to use TWO percent signs for each single one you want to use in the
- URL.
- If you want a literal percent sign to be part of the data you pass in a POST
- using -d/--data you must encode it as '%25' (which then also needs the
- percent sign doubled on Windows machines).
- 4.3 How can I use {, }, [ or ] to specify multiple URLs?
- Because those letters have a special meaning to the shell, and to be used in
- a URL specified to curl you must quote them.
- An example that downloads two URLs (sequentially) would do:
- curl '{curl,www}.haxx.se'
- To be able to use those letters as actual parts of the URL (without using
- them for the curl URL "globbing" system), use the -g/--globoff option:
- curl -g 'www.site.com/weirdname[].html'
- 4.4 Why do I get downloaded data even though the web page doesn't exist?
- Curl asks remote servers for the page you specify. If the page doesn't exist
- at the server, the HTTP protocol defines how the server should respond and
- that means that headers and a "page" will be returned. That's simply how
- HTTP works.
- By using the --fail option you can tell curl explicitly to not get any data
- if the HTTP return code doesn't say success.
- 4.5 Why do I get return code XXX from a HTTP server?
- RFC2616 clearly explains the return codes. This is a short transcript. Go
- read the RFC for exact details:
- 4.5.1 "400 Bad Request"
- The request could not be understood by the server due to malformed
- syntax. The client SHOULD NOT repeat the request without modifications.
- 4.5.2 "401 Unauthorized"
- The request requires user authentication.
- 4.5.3 "403 Forbidden"
- The server understood the request, but is refusing to fulfil it.
- Authorization will not help and the request SHOULD NOT be repeated.
- 4.5.4 "404 Not Found"
- The server has not found anything matching the Request-URI. No indication
- is given of whether the condition is temporary or permanent.
- 4.5.5 "405 Method Not Allowed"
- The method specified in the Request-Line is not allowed for the resource
- identified by the Request-URI. The response MUST include an Allow header
- containing a list of valid methods for the requested resource.
- 4.5.6 "301 Moved Permanently"
- If you get this return code and an HTML output similar to this:
- <H1>Moved Permanently</H1> The document has moved <A
- HREF="http://same_url_now_with_a_trailing_slash/">here</A>.
- it might be because you request a directory URL but without the trailing
- slash. Try the same operation again _with_ the trailing URL, or use the
- -L/--location option to follow the redirection.
- 4.6 Can you tell me what error code 142 means?
- All curl error codes are described at the end of the man page, in the
- section called "EXIT CODES".
- Error codes that are larger than the highest documented error code means
- that curl has exited due to a crash. This is a serious error, and we
- appreciate a detailed bug report from you that describes how we could go
- ahead and repeat this
- If you use a OpenSSL-powered libcurl in a multi-threaded environment, you
- need to provide one or two locking functions:
- http:
- size_t size;
- };
- /* imaginary callback function */
- size_t
- WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
- {
- size_t realsize = size * nmemb;
- struct MemoryStruct *mem = (struct MemoryStruct *)data;
- mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
- if (mem->memory) {
- memcpy(&(mem->memory[mem->size]), ptr, realsize);
- mem->size += realsize;
- mem->memory[mem->size] = 0;
- }
- return realsize;
- }
- 5.3 How do I fetch multiple files with libcurl?
- libcurl has excellent support for transferring multiple files. You should
- just repeatedly set new URLs with curl_easy_setopt() and then transfer it
- with curl_easy_perform(). The handle you get from curl_easy_init() is not
- only reusable, but you're even encouraged to reuse it if you can, as that
- will enable libcurl to use persistent connections.
- 5.4 Does libcurl do Winsock initialization on win32 systems?
- Yes, if told to in the curl_global_init() call.
- 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ?
- Yes, but you cannot open a FILE * and pass the pointer to a DLL and have
- that DLL use the FILE * (as the DLL and the client application cannot access
- each others' variable memory areas). If you set CURLOPT_WRITEDATA you must
- also use CURLOPT_WRITEFUNCTION as well to set a function that writes the
- file, even if that simply writes the data to the specified FILE *.
- Similarly, if you use CURLOPT_READDATA you must also specify
- CURLOPT_READFUNCTION.
- 5.6 What about Keep-Alive or persistent connections?
- curl and libcurl have excellent support for persistent connections when
- transferring several files from the same server. Curl will attempt to reuse
- connections for all URLs specified on the same command line/config file, and
- libcurl will reuse connections for all transfers that are made using the
- same libcurl handle.
- When you use the easy interface, the connection cache is kept within the
- easy handle. If you instead use the multi interface, the connection cache
- will be kept within the multi handle and will be shared among all the easy
- handles that are used within the same multi handle.
- 5.7 Link errors when building libcurl on Windows
- }
-
- curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this);
- 5.15 How do I get an FTP directory listing?
- If you end the FTP URL you request with a slash, libcurl will provide you
- with a directory listing of that given directory. You can also set
- CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use
- to list the files.
- The follow-up question that tend to follow the previous one, is how a
- program is supposed to parse the directory listing. How does it know what's
- a file and what's a dir and what's a symlink etc. The harsh reality is that
- FTP provides no such fine and easy-to-parse output. The output format FTP
- servers respond to LIST commands are entirely at the server's own liking and
- the NLST output doesn't reveal any types and in many cases don't even
- include all the directory entries. Also, both LIST and NLST tend to hide
- unix-style hidden files (those that start with a dot) by default so you need
- to do "LIST -a" or similar to see them.
- The application thus needs to parse the LIST output. One such existing
- list parser is available at http:
- compiling in
- features of libcurl that depend on other libraries (e.g. OpenSSL) may affect
- the licensing obligations of your application.
- 6.1 I have a GPL program, can I use the libcurl library?
- Yes
|