blob: 91eeebfafe751132f612d303bf4e8347b54a5efe [file] [log] [blame]
Daniel Stenberg1c961282002-09-03 11:58:18 +00001Updated: September 3, 2002 (http://curl.haxx.se/docs/faq.html)
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +00002 _ _ ____ _
3 ___| | | | _ \| |
4 / __| | | | |_) | |
5 | (__| |_| | _ <| |___
6 \___|\___/|_| \_\_____|
7
8FAQ
9
Daniel Stenbergc3318b42000-08-17 14:06:42 +000010 1. Philosophy
11 1.1 What is cURL?
12 1.2 What is libcurl?
13 1.3 What is cURL not?
14 1.4 When will you make curl do XXXX ?
Daniel Stenberga0eb52b2001-03-23 15:28:13 +000015 1.5 Who makes cURL?
16 1.6 What do you get for making cURL?
Daniel Stenbergc528dc52001-08-07 11:17:37 +000017 1.7 What about CURL from curl.com?
Daniel Stenberg8eaa7fe2002-04-27 18:12:26 +000018 1.8 I have a problem who do I mail?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000019
Daniel Stenbergc3318b42000-08-17 14:06:42 +000020 2. Install Related Problems
21 2.1 configure doesn't find OpenSSL even when it is installed
22 2.1.1. native linker doesn't find openssl
23 2.1.2. only the libssl lib is missing
24 2.2 Does curl work/build with other SSL libraries?
25 2.3 Where can I find a copy of LIBEAY32.DLL?
26 2.4 Does cURL support Socks (RFC 1928) ?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000027
Daniel Stenbergc3318b42000-08-17 14:06:42 +000028 3. Usage Problems
29 3.1 curl: (1) SSL is disabled, https: not supported
30 3.2 How do I tell curl to resume a transfer?
31 3.3 Why doesn't my posting using -F work?
32 3.4 How do I tell curl to run custom FTP commands?
33 3.5 How can I disable the Pragma: nocache header?
Daniel Stenberg48bc73c2002-05-21 13:53:32 +000034 3.6 Does curl support ASP, XML, XHTML or HTML version Y?
Daniel Stenbergc3318b42000-08-17 14:06:42 +000035 3.7 Can I use curl to delete/rename a file through FTP?
36 3.8 How do I tell curl to follow HTTP redirects?
Daniel Stenberg98871d12002-05-22 22:14:03 +000037 3.9 How do I use curl in my favorite programming language?
Daniel Stenberg147a6732001-03-08 09:25:09 +000038 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP?
Daniel Stenberg88d14e92001-05-29 14:02:20 +000039 3.11 How do I POST with a different Content-Type?
Daniel Stenberg6513dce2001-11-27 13:34:59 +000040 3.12 Why do FTP specific features over HTTP proxy fail?
Daniel Stenberg6b1a1a62002-03-11 08:29:26 +000041 3.13 Why does my single/double quotes fail?
Daniel Stenberg48bc73c2002-05-21 13:53:32 +000042 3.14 Does curl support javascript or pac (automated proxy config)?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000043
Daniel Stenbergc3318b42000-08-17 14:06:42 +000044 4. Running Problems
45 4.1 Problems connecting to SSL servers.
Daniel Stenberge26ee092001-01-15 10:26:37 +000046 4.2 Why do I get problems when I use & or % in the URL?
Daniel Stenbergc3318b42000-08-17 14:06:42 +000047 4.3 How can I use {, }, [ or ] to specify multiple URLs?
48 4.4 Why do I get downloaded data even though the web page doesn't exist?
49 4.5 Why do I get return code XXX from a HTTP server?
50 4.5.1 "400 Bad Request"
51 4.5.2 "401 Unauthorized"
52 4.5.3 "403 Forbidden"
53 4.5.4 "404 Not Found"
54 4.5.5 "405 Method Not Allowed"
Daniel Stenbergd60029d2001-12-19 23:25:04 +000055 4.5.6 "301 Moved Permanently"
Daniel Stenbergc3318b42000-08-17 14:06:42 +000056 4.6 Can you tell me what error code 142 means?
Daniel Stenberg4c485992001-04-22 15:45:27 +000057 4.7 How do I keep user names and passwords secret in Curl command lines?
Daniel Stenberg09ba8562000-10-27 12:25:00 +000058 4.8 I found a bug!
Daniel Stenberg2c100372000-12-19 07:30:51 +000059 4.9 Curl can't authenticate to the server that requires NTLM?
Daniel Stenbergbc743752002-05-15 21:40:29 +000060 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work!
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000061
Daniel Stenbergc3318b42000-08-17 14:06:42 +000062 5. libcurl Issues
Daniel Stenberg7d09e512001-01-11 12:52:07 +000063 5.1 Is libcurl thread-safe?
Daniel Stenberga40b55d2000-11-22 07:27:26 +000064 5.2 How can I receive all data into a large memory chunk?
Daniel Stenberg2c100372000-12-19 07:30:51 +000065 5.3 How do I fetch multiple files with libcurl?
Daniel Stenberg910fc852000-12-30 11:48:51 +000066 5.4 Does libcurl do Winsock initing on win32 systems?
Daniel Stenberg5d7b32d2001-02-04 20:08:42 +000067 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ?
Daniel Stenberg4c485992001-04-22 15:45:27 +000068 5.6 What about Keep-Alive or persistent connections?
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +000069
Daniel Stenbergc3318b42000-08-17 14:06:42 +000070 6. License Issues
71 6.1 I have a GPL program, can I use the libcurl library?
72 6.2 I have a closed-source program, can I use the libcurl library?
Daniel Stenberg31b8eea2000-08-23 07:27:00 +000073 6.3 I have a BSD licensed program, can I use the libcurl library?
74 6.4 I have a program that uses LGPL libraries, can I use libcurl?
75 6.5 Can I modify curl/libcurl for my program and keep the changes secret?
76 6.6 Can you please change the curl/libcurl license to XXXX?
Daniel Stenbergc3318b42000-08-17 14:06:42 +000077
78==============================================================================
79
801. Philosophy
81
82 1.1 What is cURL?
83
84 cURL (or simply just 'curl') is a command line tool for getting or sending
85 files using URL syntax. The name is a play on 'Client for URLs', originally
Daniel Stenberg09ba8562000-10-27 12:25:00 +000086 with URL spelled in uppercase to make it obvious it deals with URLs. The
Daniel Stenbergd16c7572002-08-08 11:54:11 +000087 fact it can also be pronounced 'see URL' also helped, it works as an
88 abbrivation for "Client URL Request Library" or why not the recursive
89 version: "Curl is a URL Request Library".
Daniel Stenbergc3318b42000-08-17 14:06:42 +000090
Daniel Stenberg4c485992001-04-22 15:45:27 +000091 Curl supports a range of common Internet protocols, currently including
Daniel Stenbergd73d28a2001-08-23 11:12:07 +000092 HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE.
Daniel Stenbergc3318b42000-08-17 14:06:42 +000093
Daniel Stenberg8e7b2612001-03-22 11:23:48 +000094 We spell it cURL or just curl. We pronounce it with an initial k sound:
95 [kurl].
Daniel Stenberg887e7282001-01-03 09:13:07 +000096
Daniel Stenbergc3318b42000-08-17 14:06:42 +000097 1.2 What is libcurl?
98
Daniel Stenbergbc5954f2001-03-23 08:16:24 +000099 libcurl is a reliable and portable library which provides you with an easy
Daniel Stenberg4c485992001-04-22 15:45:27 +0000100 interface to a range of common Internet protocols.
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000101
Daniel Stenbergbc5954f2001-03-23 08:16:24 +0000102 You can use libcurl for free in your application even if it is commercial
103 or closed-source.
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000104
105 1.3 What is cURL not?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000106
Daniel Stenberg7d24ce92001-11-01 09:12:35 +0000107 Curl is *not* a wget clone even though that is a very common misconception.
108 Never, during curl's development, have we intended curl to replace wget or
109 compete on its market. Curl is targeted at single-shot file transfers.
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000110
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000111 Curl is not a web site mirroring program. If you wanna use curl to mirror
112 something: fine, go ahead and write a script that wraps around curl to make
113 it reality (like curlmirror.pl does).
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000114
Daniel Stenberg4c485992001-04-22 15:45:27 +0000115 Curl is not an FTP site mirroring program. Sure, get and send FTP with curl
116 but if you want systematic and sequential behavior you should write a
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000117 script (or write a new program that interfaces libcurl) and do it.
118
119 Curl is not a PHP tool, even though it works perfectly well when used from
120 or with PHP.
121
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000122 Curl is not a single-OS program. Curl exists, compiles, builds and runs
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000123 under a wide range of operating systems, including all modern Unixes (and a
124 bunch of older ones too), Windows, Amiga, BeOS, OS/2, OS X, QNX etc.
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000125
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000126 1.4 When will you make curl do XXXX ?
127
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000128 We love suggestions of what to change in order to make curl and libcurl
129 better. We do however believe in a few rules when it comes to the future of
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000130 curl:
131
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000132 * Curl is to remain a command line tool. If you want GUIs or fancy scripting
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000133 capabilities, you're free to write another tool that uses libcurl and that
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000134 offers this. There's no point in having a single tool that does every
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000135 imaginable thing. That's also one of the great advantages of having the
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000136 core of curl as a library.
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000137
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000138 * We do not add things to curl that other small and available tools already
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000139 do very fine at the side. Curl's output is fine to pipe into another
140 program or redirect to another file for the next program to interpret.
141
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000142 * We focus on protocol related issues and improvements. If you wanna do more
Daniel Stenberg5f8e93d2000-10-25 07:41:58 +0000143 magic with the supported protocols than curl currently does, chances are
Daniel Stenberg7d24ce92001-11-01 09:12:35 +0000144 big we will agree. If you wanna add more protocols, we may very well
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000145 agree.
146
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000147 * If you want someone else to make all the work while you wait for us to
148 implement it for you, that is not a very friendly attitude. We spend a
149 considerable time already on maintaining and developing curl. In order to
150 get more out of us, you should consider trading in some of your time and
151 efforts in return.
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000152
153 * If you write the code, chances are bigger that it will get into curl
154 faster.
155
Daniel Stenberga0eb52b2001-03-23 15:28:13 +0000156 1.5 Who makes cURL?
157
158 cURL and libcurl are not made by any single individual. Sure, Daniel
Daniel Stenbergd16c7572002-08-08 11:54:11 +0000159 Stenberg writes the major parts, but other persons' submissions are
160 important and crucial. Anyone can contribute and post their changes and
161 improvements and have them inserted in the main sources (of course on the
162 condition that developers agree on that the fixes are good).
Daniel Stenberga0eb52b2001-03-23 15:28:13 +0000163
Daniel Stenberg81f22462001-11-27 13:33:21 +0000164 The list of contributors in the docs/THANKS file is only a small part of all
165 the people that every day provide us with bug reports, suggestions, ideas
166 and source code.
Daniel Stenberga0eb52b2001-03-23 15:28:13 +0000167
168 curl is developed by a community, with Daniel at the wheel.
169
170 1.6 What do you get for making cURL?
171
Daniel Stenbergd16c7572002-08-08 11:54:11 +0000172 Project cURL is entirely free and open. No person gets paid for developing
173 curl. We do this voluntarily on our spare time.
Daniel Stenberga0eb52b2001-03-23 15:28:13 +0000174
175 We get some help from companies. Contactor Data hosts the curl web site and
176 the main mailing list, Haxx owns the curl web site's domain and
177 sourceforge.net hosts several project tools we take advantage from like the
178 bug tracker, mailing lists and more.
179
Daniel Stenbergd3706812001-11-27 13:37:29 +0000180 If you want to support our project with a donation or similar, one way of
Daniel Stenberg25fe47f2001-11-14 20:13:38 +0000181 doing that would be to buy "gift certificates" at useful online shopping
182 sites, such as amazon.com or thinkgeek.com. Another way would be to sponsor
Daniel Stenbergd16c7572002-08-08 11:54:11 +0000183 us through a banner-program or even better: by helping us coding,
184 documenting, testing etc.
Daniel Stenbergc528dc52001-08-07 11:17:37 +0000185
186 1.7 What about CURL from curl.com?
187
188 During the summer 2001, curl.com has been busy advertising their client-side
189 programming language for the web, named CURL.
190
Daniel Stenberg81b6ebc2001-08-07 18:02:37 +0000191 We are in no way associated with curl.com or their CURL programming
192 language.
Daniel Stenbergc528dc52001-08-07 11:17:37 +0000193
Daniel Stenberg81b6ebc2001-08-07 18:02:37 +0000194 Our project name curl has been in effective use since 1998. We were not the
Daniel Stenberg4045cd52001-08-07 21:21:24 +0000195 first computer related project to use the name "curl" and do not claim any
Daniel Stenberg81b6ebc2001-08-07 18:02:37 +0000196 first-hand rights to the name.
Daniel Stenbergc528dc52001-08-07 11:17:37 +0000197
Daniel Stenberg81b6ebc2001-08-07 18:02:37 +0000198 We recognize that we will be living in parallel with curl.com and wish them
199 every success.
Daniel Stenbergc528dc52001-08-07 11:17:37 +0000200
Daniel Stenberg8eaa7fe2002-04-27 18:12:26 +0000201 1.8 I have a problem who do I mail?
202
203 Please do not attempt to mail any single individual unless you really need
204 to. Keep curl-related questions on a suitable mailing list. All available
205 mailing lists are listed in the MANUAL document and online at
206 http://curl.haxx.se/mail/
207
Daniel Stenberg98871d12002-05-22 22:14:03 +0000208 Keeping curl-related questions and discussions on mailing lists allows others
Daniel Stenberg8eaa7fe2002-04-27 18:12:26 +0000209 to join in and help, to share their ideas, contribute their suggestions and
210 spread their wisdom. Keeping discussions on public mailing lists also allows
211 for others to learn from this (both current and future users thanks to the
212 web based archives of the mailing lists), thus saving us from having to
213 repeat ourselves even more. Thanks for respecting this.
214
215
Daniel Stenbergc3318b42000-08-17 14:06:42 +00002162. Install Related Problems
217
218 2.1. configure doesn't find OpenSSL even when it is installed
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000219
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000220 This may be because of several reasons.
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000221
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000222 2.1.1. native linker doesn't find openssl
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000223
Daniel Stenbergbfb16902000-08-17 11:42:59 +0000224 Affected platforms:
225 Solaris (native cc compiler)
226 HPUX (native cc compiler)
227 SGI IRIX (native cc compiler)
Daniel Stenberg13962ad2000-09-28 10:26:44 +0000228 SCO UNIX (native cc compiler)
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000229
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000230 When configuring curl, I specify --with-ssl. OpenSSL is installed in
231 /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find
232 CRYPTO_lock in -lcrypto
Daniel Stenberg7c37c6a2000-05-22 17:35:35 +0000233
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000234 Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER
235 -lcrypto, so ld can't find the library. This is due to a bug in the GNU
236 autoconf tool.
237
238 Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of
239 ./configure places the -L/usr/local/ssl/lib early enough in the command
240 line to make things work
241
Daniel Stenbergbfb16902000-08-17 11:42:59 +0000242 Solution submitted by: Bob Allison <allisonb@users.sourceforge.net>
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000243
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000244 2.1.2. only the libssl lib is missing
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000245
246 If all include files and the libcrypto lib is present, with only the
247 libssl being missing according to configure, this is mostly likely because
248 a few functions are left out from the libssl.
249
250 If the function names missing include RSA or RSAREF you can be certain
Daniel Stenberg4c485992001-04-22 15:45:27 +0000251 that this is because libssl requires the RSA and RSAREF libs to build.
Daniel Stenbergef34ad22000-06-02 12:45:23 +0000252
253 See the INSTALL file section that explains how to add those libs to
254 configure. Make sure that you remove the config.cache file before you
255 rerun configure with the new flags.
256
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000257 2.2. Does curl work/build with other SSL libraries?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000258
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000259 Curl has been written to use OpenSSL, although there should not be much
Daniel Stenberg26d1aac2001-02-16 13:41:09 +0000260 problems using a different library. If anyone does "port" curl to use a
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000261 different SSL library, we are of course very interested in getting the
262 patch!
Daniel Stenberge9640b62000-08-02 07:17:56 +0000263
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000264 2.3. Where can I find a copy of LIBEAY32.DLL?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000265
266 That is an OpenSSL binary built for Windows.
267
268 Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000269 on a windows machine to do https://. Check out the curl web site to find
Daniel Stenberg4c485992001-04-22 15:45:27 +0000270 accurate and up-to-date pointers to recent OpenSSL DLLs and other binary
Daniel Stenberge9640b62000-08-02 07:17:56 +0000271 packages.
272
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000273 2.4. Does cURL support Socks (RFC 1928) ?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000274
Daniel Stenberg4c485992001-04-22 15:45:27 +0000275 No. Nobody has wanted it that badly yet. We appreciate patches that bring
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000276 this functionality.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000277
278
Daniel Stenbergc3318b42000-08-17 14:06:42 +00002793. Usage problems
Daniel Stenberge9640b62000-08-02 07:17:56 +0000280
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000281 3.1. curl: (1) SSL is disabled, https: not supported
Daniel Stenberge9640b62000-08-02 07:17:56 +0000282
283 If you get this output when trying to get anything from a https:// server,
284 it means that the configure script couldn't find all libs and include files
285 it requires for SSL to work. If the configure script fails to find them,
286 curl is simply built without SSL support.
287
288 To get the https:// support into a curl that was previously built but that
289 reports that https:// is not supported, you should dig through the document
290 and logs and check out why the configure script doesn't find the SSL libs
291 and/or include files.
292
293 Also, check out the other paragraph in this FAQ labeled "configure doesn't
294 find OpenSSL even when it is installed".
295
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000296 3.2. How do I tell curl to resume a transfer?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000297
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000298 Curl supports resumed transfers both ways on both FTP and HTTP.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000299
Daniel Stenberg887e7282001-01-03 09:13:07 +0000300 Try the -C option.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000301
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000302 3.3. Why doesn't my posting using -F work?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000303
304 You can't simply use -F or -d at your choice. The web server that will
305 receive your post assumes one of the formats. If the form you're trying to
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000306 "fake" sets the type to 'multipart/form-data', then and only then you must
Daniel Stenberge9640b62000-08-02 07:17:56 +0000307 use the -F type. In all the most common cases, you should use -d which then
308 causes a posting with the type 'application/x-www-form-urlencoded'.
309
Daniel Stenberg4c485992001-04-22 15:45:27 +0000310 This is described in some detail in the MANUAL and TheArtOfHttpScripting
311 documents, and if you don't understand it the first time, read it again
312 before you post questions about this to the mailing list. Also, try reading
313 through the mailing list archives for old postings and questions regarding
314 this.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000315
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000316 3.4. How do I tell curl to run custom FTP commands?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000317
318 You can tell curl to perform optional commands both before and/or after a
319 file transfer. Study the -Q/--quote option.
320
321 Since curl is used for file transfers, you don't use curl to just perform
Daniel Stenberg4c485992001-04-22 15:45:27 +0000322 FTP commands without transferring anything. Therefore you must always specify
Daniel Stenberge9640b62000-08-02 07:17:56 +0000323 a URL to transfer to/from even when doing custom FTP commands.
324
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000325 3.5. How can I disable the Pragma: nocache header?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000326
327 You can change all internally generated headers by adding a replacement with
328 the -H/--header option. By adding a header with empty contents you safely
329 disable that one. Use -H "Pragma:" to disable that specific header.
330
Daniel Stenberg48bc73c2002-05-21 13:53:32 +0000331 3.6. Does curl support ASP, XML, XHTML or HTML version Y?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000332
333 To curl, all contents are alike. It doesn't matter how the page was
Daniel Stenberg4c485992001-04-22 15:45:27 +0000334 generated. It may be ASP, PHP, Perl, shell-script, SSI or plain
Daniel Stenberge9640b62000-08-02 07:17:56 +0000335 HTML-files. There's no difference to curl and it doesn't even know what kind
336 of language that generated the page.
337
Daniel Stenberg20807382002-05-21 14:00:55 +0000338 See also item 3.14 regarding javascript.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000339
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000340 3.7. Can I use curl to delete/rename a file through FTP?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000341
Daniel Stenberg4c485992001-04-22 15:45:27 +0000342 Yes. You specify custom FTP commands with -Q/--quote.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000343
344 One example would be to delete a file after you have downloaded it:
345
346 curl -O ftp://download.com/coolfile -Q '-DELE coolfile'
347
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000348 3.8 How do I tell curl to follow HTTP redirects?
Daniel Stenberge9640b62000-08-02 07:17:56 +0000349
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000350 Curl does not follow so-called redirects by default. The Location: header
351 that informs the client about this is only interpreted if you're using the
352 -L/--location option. As in:
Daniel Stenberge9640b62000-08-02 07:17:56 +0000353
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000354 curl -L http://redirector.com
355
Daniel Stenberg98871d12002-05-22 22:14:03 +0000356 3.9 How do I use curl in my favorite programming language?
Daniel Stenberg368e3522001-01-29 10:16:21 +0000357
Daniel Stenbergdfdf4912001-12-21 09:20:04 +0000358 There exist many language interfaces/bindings for curl that integrates it
359 better with various languages. If you are fluid in a script language, you
360 may very well opt to use such an interface instead of using the command line
361 tool.
Daniel Stenberg4c485992001-04-22 15:45:27 +0000362
Daniel Stenberg4c485992001-04-22 15:45:27 +0000363 Find out more about which languages that support curl directly, and how to
364 install and use them, in the libcurl section of the curl web site:
365
366 http://curl.haxx.se/libcurl/
Daniel Stenberg368e3522001-01-29 10:16:21 +0000367
Daniel Stenbergdfdf4912001-12-21 09:20:04 +0000368 In December 2001, there are interfaces available for the following
369 languages: C/C++, Cocoa, Dylan, Java, Perl, PHP, Python, Rexx, Ruby, Scheme
370 and Tcl. By the time you read this, additional ones may have appeared!
Daniel Stenberg368e3522001-01-29 10:16:21 +0000371
Daniel Stenberg147a6732001-03-08 09:25:09 +0000372 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP?
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000373
374 Curl adheres to the HTTP spec, which basically means you can play with *any*
Daniel Stenberg4c485992001-04-22 15:45:27 +0000375 protocol that is built on top of HTTP. Protocols such as SOAP, WEBDAV and
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000376 XML-RPC are all such ones. You can use -X to set custom requests and -H to
377 set custom headers (or replace internally generated ones).
378
379 Using libcurl or PHP's curl modules is just as fine and you'd just use the
380 proper library options to do the same.
381
Daniel Stenberg88d14e92001-05-29 14:02:20 +0000382 3.11 How do I POST with a different Content-Type?
383
384 You can always replace the internally generated headers with -H/--header.
385 To make a simple HTTP POST with text/xml as content-type, do something like:
386
387 curl -d "datatopost" -H "Content-Type: text/xml" [URL]
388
Daniel Stenberg50e9f8f2001-10-23 10:12:28 +0000389 3.12 Why do FTP specific features over HTTP proxy fail?
Daniel Stenberg7d3daa52001-10-23 10:12:00 +0000390
391 Because when you use a HTTP proxy, the protocol spoken on the network will
392 be HTTP, even if you specify a FTP URL. This effectively means that you
Daniel Stenberg98871d12002-05-22 22:14:03 +0000393 normally can't use FTP specific features such as FTP upload and FTP quote
Daniel Stenberg7d3daa52001-10-23 10:12:00 +0000394 etc.
395
396 There is one exception to this rule, and that is if you can "tunnel through"
Daniel Stenberg271f96f2001-11-20 08:03:01 +0000397 the given HTTP proxy. Proxy tunneling is enabled with a special option (-p)
Daniel Stenberg97a8c982001-12-21 08:10:34 +0000398 and is generally not available as proxy admins usually disable tunneling to
Daniel Stenberg7d3daa52001-10-23 10:12:00 +0000399 other ports than 443 (which is used for HTTPS access through proxies).
400
Daniel Stenberg6b1a1a62002-03-11 08:29:26 +0000401 3.13 Why does my single/double quotes fail?
402
403 To specify a command line option that includes spaces, you might need to
404 put the entire option within quotes. Like in:
405
406 curl -d " with spaces " url.com
407
408 or perhaps
409
410 curl -d ' with spaces ' url.com
411
412 Exactly what kind of quotes and how to do this is entirely up to the shell
Daniel Stenberg98871d12002-05-22 22:14:03 +0000413 or command line interpreter that you are using. For most unix shells, you
Daniel Stenberg6b1a1a62002-03-11 08:29:26 +0000414 can more or less pick either single (') or double (") quotes. For
415 Windows/DOS prompts I believe you're forced to use double (") quotes.
416
Daniel Stenberg98871d12002-05-22 22:14:03 +0000417 Please study the documentation for your particular environment. Examples in
Daniel Stenberg6b1a1a62002-03-11 08:29:26 +0000418 the curl docs will use a mix of both these ones as shown above. You must
419 adjust them to work in your environment.
420
Daniel Stenberg61f62842002-03-11 08:39:00 +0000421 Remember that curl works and runs on more operating systems than most single
Daniel Stenberg6b1a1a62002-03-11 08:29:26 +0000422 individuals have ever tried.
423
Daniel Stenberg48bc73c2002-05-21 13:53:32 +0000424 3.14 Does curl support javascript or pac (automated proxy config)?
425
426 Many web pages do magic stuff using embedded javascript. Curl and libcurl
427 have no built-in support for that, so it will be treated just like any other
428 contents.
429
430 .pac files are a netscape invention and are sometimes used by organizations
431 to allow them to differentiate which proxies to use. The .pac contents is
432 just a javascript program that gets invoked by the browser and that returns
433 the name of the proxy to connect to. Since curl doesn't support javascript,
434 it can't support .pac proxy configuration either.
435
436 Some work-arounds usually suggested to overcome this javascript dependency:
437
438 - Depending on the javascript complexity, write up a script that
439 translates it to another language and execute that.
440
441 - Read the javascript code and rewrite the same logic in another language.
442
443 - Implement a javascript interpreted, people have successfully used the
444 Mozilla javascript engine in the past.
445
446 - Ask your admins to stop this, for a static proxy setup or similar.
447
Daniel Stenberg6b1a1a62002-03-11 08:29:26 +0000448
Daniel Stenbergc3318b42000-08-17 14:06:42 +00004494. Running Problems
450
451 4.1. Problems connecting to SSL servers.
Daniel Stenberge9640b62000-08-02 07:17:56 +0000452
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000453 It took a very long time before we could sort out why curl had problems to
454 connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. The
455 error sometimes showed up similar to:
Daniel Stenberge9640b62000-08-02 07:17:56 +0000456
457 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233:
458
459 It turned out to be because many older SSL servers don't deal with SSLv3
460 requests properly. To correct this problem, tell curl to select SSLv2 from
461 the command line (-2/--sslv2).
462
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000463 There has also been examples where the remote server didn't like the SSLv2
Daniel Stenberge9640b62000-08-02 07:17:56 +0000464 request and instead you had to force curl to use SSLv3 with -3/--sslv3.
465
Daniel Stenberge26ee092001-01-15 10:26:37 +0000466 4.2. Why do I get problems when I use & or % in the URL?
Daniel Stenberg29470102000-06-02 13:32:01 +0000467
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000468 In general unix shells, the & letter is treated special and when used, it
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000469 runs the specified command in the background. To safely send the & as a part
Daniel Stenberg4c485992001-04-22 15:45:27 +0000470 of a URL, you should quote the entire URL by using single (') or double (")
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000471 quotes around it.
Daniel Stenberg29470102000-06-02 13:32:01 +0000472
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000473 An example that would invoke a remote CGI that uses &-letters could be:
Daniel Stenberg8f037322000-06-06 14:09:01 +0000474
Daniel Stenbergedcd5df2000-06-06 14:13:36 +0000475 curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
Daniel Stenberg8f037322000-06-06 14:09:01 +0000476
Daniel Stenbergdaf55702002-08-29 07:05:31 +0000477 In Windows, the standard DOS shell treats the %-letter specially and you
478 need to use TWO %-letters for each single one you want to use in the URL.
Daniel Stenberge26ee092001-01-15 10:26:37 +0000479
Daniel Stenberg1b77c182001-01-29 10:24:51 +0000480 Also note that if you want the literal %-letter to be part of the data you
Daniel Stenbergdaf55702002-08-29 07:05:31 +0000481 pass in a POST using -d/--data you must encode it as '%25' (which then also
482 needs the %-letter doubled on Windows machines).
Daniel Stenberg1b77c182001-01-29 10:24:51 +0000483
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000484 4.3. How can I use {, }, [ or ] to specify multiple URLs?
Daniel Stenberg29470102000-06-02 13:32:01 +0000485
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000486 Because those letters have a special meaning to the shell, and to be used in
487 a URL specified to curl you must quote them.
Daniel Stenberg29470102000-06-02 13:32:01 +0000488
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000489 An example that downloads two URLs (sequentially) would do:
Daniel Stenberg8f037322000-06-06 14:09:01 +0000490
Daniel Stenbergedcd5df2000-06-06 14:13:36 +0000491 curl '{curl,www}.haxx.se'
Daniel Stenberg8f037322000-06-06 14:09:01 +0000492
Daniel Stenberge26ee092001-01-15 10:26:37 +0000493 To be able to use those letters as actual parts of the URL (without using
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000494 them for the curl URL "globbing" system), use the -g/--globoff option (curl
495 7.6 and later):
Daniel Stenberge26ee092001-01-15 10:26:37 +0000496
497 curl -g 'www.site.com/weirdname[].html'
498
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000499 4.4. Why do I get downloaded data even though the web page doesn't exist?
Daniel Stenberg29470102000-06-02 13:32:01 +0000500
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000501 Curl asks remote servers for the page you specify. If the page doesn't exist
502 at the server, the HTTP protocol defines how the server should respond and
503 that means that headers and a "page" will be returned. That's simply how
504 HTTP works.
Daniel Stenberg29470102000-06-02 13:32:01 +0000505
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000506 By using the --fail option you can tell curl explicitly to not get any data
507 if the HTTP return code doesn't say success.
Daniel Stenberg8f037322000-06-06 14:09:01 +0000508
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000509 4.5 Why do I get return code XXX from a HTTP server?
Daniel Stenberg29470102000-06-02 13:32:01 +0000510
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000511 RFC2616 clearly explains the return codes. This is a short transcript. Go
512 read the RFC for exact details:
Daniel Stenberg29470102000-06-02 13:32:01 +0000513
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000514 4.5.1 "400 Bad Request"
Daniel Stenberg29470102000-06-02 13:32:01 +0000515
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000516 The request could not be understood by the server due to malformed
517 syntax. The client SHOULD NOT repeat the request without modifications.
518
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000519 4.5.2 "401 Unauthorized"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000520
521 The request requires user authentication.
522
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000523 4.5.3 "403 Forbidden"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000524
525 The server understood the request, but is refusing to fulfill it.
526 Authorization will not help and the request SHOULD NOT be repeated.
527
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000528 4.5.4 "404 Not Found"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000529
530 The server has not found anything matching the Request-URI. No indication
531 is given of whether the condition is temporary or permanent.
532
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000533 4.5.5 "405 Method Not Allowed"
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000534
535 The method specified in the Request-Line is not allowed for the resource
536 identified by the Request-URI. The response MUST include an Allow header
537 containing a list of valid methods for the requested resource.
538
Daniel Stenbergd60029d2001-12-19 23:25:04 +0000539 4.5.6 "301 Moved Permanently"
540
Daniel Stenberg98871d12002-05-22 22:14:03 +0000541 If you get this return code and an HTML output similar to this:
Daniel Stenbergd60029d2001-12-19 23:25:04 +0000542
543 <H1>Moved Permanently</H1> The document has moved <A
544 HREF="http://same_url_now_with_a_trailing_slash/">here</A>.
545
546 it might be because you request a directory URL but without the trailing
547 slash. Try the same operation again _with_ the trailing URL, or use the
548 -L/--location option to follow the redirection.
549
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000550 4.6. Can you tell me what error code 142 means?
Daniel Stenberg29470102000-06-02 13:32:01 +0000551
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000552 All error codes that are larger than the highest documented error code means
Daniel Stenberg13bf9642001-08-23 11:11:13 +0000553 that curl has exited due to a crash. This is a serious error, and we
Daniel Stenberg25fe47f2001-11-14 20:13:38 +0000554 appreciate a detailed bug report from you that describes how we could go
Daniel Stenberg13bf9642001-08-23 11:11:13 +0000555 ahead and repeat this!
Daniel Stenberg29470102000-06-02 13:32:01 +0000556
Daniel Stenberg4c485992001-04-22 15:45:27 +0000557 4.7. How do I keep user names and passwords secret in Curl command lines?
Daniel Stenberg29470102000-06-02 13:32:01 +0000558
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000559 This problem has two sides:
Daniel Stenberg29470102000-06-02 13:32:01 +0000560
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000561 The first part is to avoid having clear-text passwords in the command line
562 so that they don't appear in 'ps' outputs and similar. That is easily
Daniel Stenberg4c485992001-04-22 15:45:27 +0000563 avoided by using the "-K" option to tell curl to read parameters from a
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000564 file or stdin to which you can pass the secret info.
Daniel Stenberg29470102000-06-02 13:32:01 +0000565
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000566 To keep the passwords in your account secret from the rest of the world is
567 not a task that curl addresses. You could of course encrypt them somehow to
568 at least hide them from being read by human eyes, but that is not what
569 anyone would call security.
Daniel Stenberg29470102000-06-02 13:32:01 +0000570
Daniel Stenberg887e7282001-01-03 09:13:07 +0000571 Also note that regular HTTP and FTP passwords are sent in clear across the
572 network. All it takes for anyone to fetch them is to listen on the network.
Daniel Stenberg4c485992001-04-22 15:45:27 +0000573 Eavesdropping is very easy.
Daniel Stenberg887e7282001-01-03 09:13:07 +0000574
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000575 4.8 I found a bug!
576
Daniel Stenberg4c485992001-04-22 15:45:27 +0000577 It is not a bug if the behavior is documented. Read the docs first.
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000578
579 If it is a problem with a binary you've downloaded or a package for your
580 particular platform, try contacting the person who built the package/archive
581 you have.
582
Daniel Stenberg8eaa7fe2002-04-27 18:12:26 +0000583 If there is a bug, read the BUGS document first. Then report it as described
584 in there.
Daniel Stenberg09ba8562000-10-27 12:25:00 +0000585
Daniel Stenberg2c100372000-12-19 07:30:51 +0000586 4.9. Curl can't authenticate to the server that requires NTLM?
587
588 NTLM is a Microsoft proprietary protocol. Unfortunately, curl does not
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000589 currently support that. Proprietary formats are evil. You should not use
590 such ones.
Daniel Stenberg29470102000-06-02 13:32:01 +0000591
Daniel Stenbergbc743752002-05-15 21:40:29 +0000592 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work!
593
594 Many web servers allow or demand that the administrator configures the
595 server properly for these requests to work on the web server.
596
597 Some servers seem to support HEAD only on certain kinds of URLs.
598
599 To fully grasp this, try the documentation for the particular server
600 software you're trying to interact with. This is not anything curl can do
601 anything about.
602
603
Daniel Stenbergc3318b42000-08-17 14:06:42 +00006045. libcurl Issues
Daniel Stenberg29470102000-06-02 13:32:01 +0000605
Daniel Stenberg7d09e512001-01-11 12:52:07 +0000606 5.1. Is libcurl thread-safe?
Daniel Stenberg29470102000-06-02 13:32:01 +0000607
Daniel Stenberg7d09e512001-01-11 12:52:07 +0000608 Yes.
609
610 We have written the libcurl code specificly adjusted for multi-threaded
611 programs. libcurl will use thread-safe functions instead of non-safe ones if
612 your system has such.
Daniel Stenberg29470102000-06-02 13:32:01 +0000613
Daniel Stenberg4c485992001-04-22 15:45:27 +0000614 We would appreciate some kind of report or README file from those who have
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000615 used libcurl in a threaded environment.
Daniel Stenberg29470102000-06-02 13:32:01 +0000616
Daniel Stenberga40b55d2000-11-22 07:27:26 +0000617 5.2 How can I receive all data into a large memory chunk?
618
Daniel Stenberga84af982001-05-15 13:09:27 +0000619 [ See also the examples/getinmemory.c source ]
620
Daniel Stenberga40b55d2000-11-22 07:27:26 +0000621 You are in full control of the callback function that gets called every time
622 there is data received from the remote server. You can make that callback do
Daniel Stenberg4c485992001-04-22 15:45:27 +0000623 whatever you want. You do not have to write the received data to a file.
Daniel Stenberga40b55d2000-11-22 07:27:26 +0000624
625 One solution to this problem could be to have a pointer to a struct that you
626 pass to the callback function. You set the pointer using the
627 curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to
628 the callback instead of a FILE * to a file:
629
630 /* imaginary struct */
631 struct MemoryStruct {
632 char *memory;
633 size_t size;
634 };
635
636 /* imaginary callback function */
637 size_t
638 WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
639 {
640 register int realsize = size * nmemb;
641 struct MemoryStruct *mem = (struct MemoryStruct *)data;
642
643 mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
644 if (mem->memory) {
645 memcpy(&(mem->memory[mem->size]), ptr, realsize);
646 mem->size += realsize;
647 mem->memory[mem->size] = 0;
648 }
649 return realsize;
650 }
651
Daniel Stenberg2c100372000-12-19 07:30:51 +0000652 5.3 How do I fetch multiple files with libcurl?
Daniel Stenbergec5ac822000-12-14 08:37:09 +0000653
Daniel Stenberg5dd0a8a2001-03-06 14:37:37 +0000654 Starting with version 7.7, curl and libcurl will have excellent support for
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000655 transferring multiple files. You should just repeatedly set new URLs with
656 curl_easy_setopt() and then transfer it with curl_easy_perform(). The handle
657 you get from curl_easy_init() is not only reusable starting with libcurl
658 7.7, but also you're encouraged to reuse it if you can, as that will enable
Daniel Stenberg4c485992001-04-22 15:45:27 +0000659 libcurl to use persistent connections.
Daniel Stenberg5dd0a8a2001-03-06 14:37:37 +0000660
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000661 For libcurl prior to 7.7, there was no multiple file support. The only
662 available way to do multiple requests was to init/perform/cleanup for each
663 transfer.
Daniel Stenberga40b55d2000-11-22 07:27:26 +0000664
Daniel Stenbergbc5954f2001-03-23 08:16:24 +0000665 5.4 Does libcurl do Winsock initialization on win32 systems?
Daniel Stenberg910fc852000-12-30 11:48:51 +0000666
Daniel Stenberg6d213e22001-11-01 14:51:02 +0000667 Yes (since 7.8.1) if told to in the curl_global_init() call.
Daniel Stenberg910fc852000-12-30 11:48:51 +0000668
Daniel Stenberg5d7b32d2001-02-04 20:08:42 +0000669 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ?
Daniel Stenberg41084e52001-01-22 08:42:00 +0000670
671 Yes, but you cannot open a FILE * and pass the pointer to a DLL and have
Daniel Stenberg5d7b32d2001-02-04 20:08:42 +0000672 that DLL use the FILE *. If you set CURLOPT_FILE you must also use
673 CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even
674 if that simply writes the data to the specified FILE*. Similarly, if you use
675 CURLOPT_INFILE you must also specify CURLOPT_READFUNCTION.
Daniel Stenberg41084e52001-01-22 08:42:00 +0000676
Daniel Stenberg5d7b32d2001-02-04 20:08:42 +0000677 (Provided by Joel DeYoung and Bob Schader)
Daniel Stenberg41084e52001-01-22 08:42:00 +0000678
Daniel Stenberg4c485992001-04-22 15:45:27 +0000679 5.6 What about Keep-Alive or persistent connections?
Daniel Stenberg6dc5c6f2001-01-27 20:51:31 +0000680
Daniel Stenberg5dd0a8a2001-03-06 14:37:37 +0000681 Starting with version 7.7, curl and libcurl will have excellent support for
Daniel Stenberg4c485992001-04-22 15:45:27 +0000682 persistent connections when transferring several files from the same server.
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000683 Curl will attempt to reuse connections for all URLs specified on the same
684 command line/config file, and libcurl will reuse connections for all
685 transfers that are made using the same libcurl handle.
Daniel Stenberg5dd0a8a2001-03-06 14:37:37 +0000686
Daniel Stenberg4c485992001-04-22 15:45:27 +0000687 Previous versions had no persistent connection support.
Daniel Stenberg6dc5c6f2001-01-27 20:51:31 +0000688
Daniel Stenbergc3318b42000-08-17 14:06:42 +00006896. License Issues
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000690
Daniel Stenberg1c961282002-09-03 11:58:18 +0000691 Curl and libcurl are released under a MIT/X derivate license. The license is
692 very liberal and should not impose a problem for your project. This section
693 is just a brief summary for the cases we get the most questions. (Parts of
694 this section was much enhanced by Bjorn Reese.)
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000695
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000696 6.1. I have a GPL program, can I use the libcurl library?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000697
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000698 Yes!
Daniel Stenberg7d1ef962000-08-14 06:31:59 +0000699
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000700 Since libcurl may be distributed under the MIT/X derivate license, it can be
701 used together with GPL in any software.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000702
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000703 6.2. I have a closed-source program, can I use the libcurl library?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000704
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000705 Yes!
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000706
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000707 libcurl does not put any restrictions on the program that uses the library.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000708
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000709 6.3. I have a BSD licensed program, can I use the libcurl library?
710
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000711 Yes!
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000712
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000713 libcurl does not put any restrictions on the program that uses the library.
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000714
715 6.4. I have a program that uses LGPL libraries, can I use libcurl?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000716
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000717 Yes!
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000718
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000719 The LGPL license doesn't clash with other licenses.
Daniel Stenbergc3318b42000-08-17 14:06:42 +0000720
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000721 6.5. Can I modify curl/libcurl for my program and keep the changes secret?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000722
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000723 Yes!
Daniel Stenberg0d181b52001-01-04 12:43:53 +0000724
725 The MIT/X derivate license practically allows you to do almost anything with
726 the sources, on the condition that the copyright texts in the sources are
727 left intact.
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000728
Daniel Stenberg31b8eea2000-08-23 07:27:00 +0000729 6.6. Can you please change the curl/libcurl license to XXXX?
Daniel Stenbergc3c77392000-07-31 22:42:34 +0000730
Daniel Stenbergc59baa02001-02-12 10:05:09 +0000731 No.
732
Daniel Stenberg11d718b2001-03-13 11:47:30 +0000733 We have carefully picked this license after years of development and
734 discussions and a large amount of people have contributed with source code
735 knowing that this is the license we use. This license puts the restrictions
736 we want on curl/libcurl and it does not spread to other programs or
737 libraries that use it. The recent dual license modification should make it
738 possible for everyone to use libcurl or curl in their projects, no matter
739 what license they already have in use.