| Daniel Stenberg | 97a8c98 | 2001-12-21 08:10:34 +0000 | [diff] [blame] | 1 | Updated: December 21, 2001 (http://curl.haxx.se/docs/faq.shtml) |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 2 | _ _ ____ _ |
| 3 | ___| | | | _ \| | |
| 4 | / __| | | | |_) | | |
| 5 | | (__| |_| | _ <| |___ |
| 6 | \___|\___/|_| \_\_____| |
| 7 | |
| 8 | FAQ |
| 9 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 10 | 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 Stenberg | a0eb52b | 2001-03-23 15:28:13 +0000 | [diff] [blame] | 15 | 1.5 Who makes cURL? |
| 16 | 1.6 What do you get for making cURL? |
| Daniel Stenberg | c528dc5 | 2001-08-07 11:17:37 +0000 | [diff] [blame] | 17 | 1.7 What about CURL from curl.com? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 18 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 19 | 2. Install Related Problems |
| 20 | 2.1 configure doesn't find OpenSSL even when it is installed |
| 21 | 2.1.1. native linker doesn't find openssl |
| 22 | 2.1.2. only the libssl lib is missing |
| 23 | 2.2 Does curl work/build with other SSL libraries? |
| 24 | 2.3 Where can I find a copy of LIBEAY32.DLL? |
| 25 | 2.4 Does cURL support Socks (RFC 1928) ? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 26 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 27 | 3. Usage Problems |
| 28 | 3.1 curl: (1) SSL is disabled, https: not supported |
| 29 | 3.2 How do I tell curl to resume a transfer? |
| 30 | 3.3 Why doesn't my posting using -F work? |
| 31 | 3.4 How do I tell curl to run custom FTP commands? |
| 32 | 3.5 How can I disable the Pragma: nocache header? |
| 33 | 3.6 Does curl support javascript, ASP, XML, XHTML or HTML version Y? |
| 34 | 3.7 Can I use curl to delete/rename a file through FTP? |
| 35 | 3.8 How do I tell curl to follow HTTP redirects? |
| Daniel Stenberg | dfdf491 | 2001-12-21 09:20:04 +0000 | [diff] [blame^] | 36 | 3.9 How do I use curl in my favourite programming language? |
| Daniel Stenberg | 147a673 | 2001-03-08 09:25:09 +0000 | [diff] [blame] | 37 | 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? |
| Daniel Stenberg | 88d14e9 | 2001-05-29 14:02:20 +0000 | [diff] [blame] | 38 | 3.11 How do I POST with a different Content-Type? |
| Daniel Stenberg | 6513dce | 2001-11-27 13:34:59 +0000 | [diff] [blame] | 39 | 3.12 Why do FTP specific features over HTTP proxy fail? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 40 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 41 | 4. Running Problems |
| 42 | 4.1 Problems connecting to SSL servers. |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 43 | 4.2 Why do I get problems when I use & or % in the URL? |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 44 | 4.3 How can I use {, }, [ or ] to specify multiple URLs? |
| 45 | 4.4 Why do I get downloaded data even though the web page doesn't exist? |
| 46 | 4.5 Why do I get return code XXX from a HTTP server? |
| 47 | 4.5.1 "400 Bad Request" |
| 48 | 4.5.2 "401 Unauthorized" |
| 49 | 4.5.3 "403 Forbidden" |
| 50 | 4.5.4 "404 Not Found" |
| 51 | 4.5.5 "405 Method Not Allowed" |
| Daniel Stenberg | d60029d | 2001-12-19 23:25:04 +0000 | [diff] [blame] | 52 | 4.5.6 "301 Moved Permanently" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 53 | 4.6 Can you tell me what error code 142 means? |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 54 | 4.7 How do I keep user names and passwords secret in Curl command lines? |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 55 | 4.8 I found a bug! |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 56 | 4.9 Curl can't authenticate to the server that requires NTLM? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 57 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 58 | 5. libcurl Issues |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 59 | 5.1 Is libcurl thread-safe? |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 60 | 5.2 How can I receive all data into a large memory chunk? |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 61 | 5.3 How do I fetch multiple files with libcurl? |
| Daniel Stenberg | 910fc85 | 2000-12-30 11:48:51 +0000 | [diff] [blame] | 62 | 5.4 Does libcurl do Winsock initing on win32 systems? |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 63 | 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ? |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 64 | 5.6 What about Keep-Alive or persistent connections? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 65 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 66 | 6. License Issues |
| 67 | 6.1 I have a GPL program, can I use the libcurl library? |
| 68 | 6.2 I have a closed-source program, can I use the libcurl library? |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 69 | 6.3 I have a BSD licensed program, can I use the libcurl library? |
| 70 | 6.4 I have a program that uses LGPL libraries, can I use libcurl? |
| 71 | 6.5 Can I modify curl/libcurl for my program and keep the changes secret? |
| 72 | 6.6 Can you please change the curl/libcurl license to XXXX? |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 73 | |
| 74 | ============================================================================== |
| 75 | |
| 76 | 1. Philosophy |
| 77 | |
| 78 | 1.1 What is cURL? |
| 79 | |
| 80 | cURL (or simply just 'curl') is a command line tool for getting or sending |
| 81 | files using URL syntax. The name is a play on 'Client for URLs', originally |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 82 | with URL spelled in uppercase to make it obvious it deals with URLs. The |
| 83 | fact it can also be pronounced 'see URL' also helped. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 84 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 85 | Curl supports a range of common Internet protocols, currently including |
| Daniel Stenberg | d73d28a | 2001-08-23 11:12:07 +0000 | [diff] [blame] | 86 | HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 87 | |
| Daniel Stenberg | 8e7b261 | 2001-03-22 11:23:48 +0000 | [diff] [blame] | 88 | We spell it cURL or just curl. We pronounce it with an initial k sound: |
| 89 | [kurl]. |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 90 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 91 | 1.2 What is libcurl? |
| 92 | |
| Daniel Stenberg | bc5954f | 2001-03-23 08:16:24 +0000 | [diff] [blame] | 93 | libcurl is a reliable and portable library which provides you with an easy |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 94 | interface to a range of common Internet protocols. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 95 | |
| Daniel Stenberg | bc5954f | 2001-03-23 08:16:24 +0000 | [diff] [blame] | 96 | You can use libcurl for free in your application even if it is commercial |
| 97 | or closed-source. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 98 | |
| 99 | 1.3 What is cURL not? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 100 | |
| Daniel Stenberg | 7d24ce9 | 2001-11-01 09:12:35 +0000 | [diff] [blame] | 101 | Curl is *not* a wget clone even though that is a very common misconception. |
| 102 | Never, during curl's development, have we intended curl to replace wget or |
| 103 | compete on its market. Curl is targeted at single-shot file transfers. |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 104 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 105 | Curl is not a web site mirroring program. If you wanna use curl to mirror |
| 106 | something: fine, go ahead and write a script that wraps around curl to make |
| 107 | it reality (like curlmirror.pl does). |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 108 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 109 | Curl is not an FTP site mirroring program. Sure, get and send FTP with curl |
| 110 | but if you want systematic and sequential behavior you should write a |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 111 | script (or write a new program that interfaces libcurl) and do it. |
| 112 | |
| 113 | Curl is not a PHP tool, even though it works perfectly well when used from |
| 114 | or with PHP. |
| 115 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 116 | Curl is not a single-OS program. Curl exists, compiles, builds and runs |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 117 | under a wide range of operating systems, including all modern Unixes (and a |
| 118 | bunch of older ones too), Windows, Amiga, BeOS, OS/2, OS X, QNX etc. |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 119 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 120 | 1.4 When will you make curl do XXXX ? |
| 121 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 122 | We love suggestions of what to change in order to make curl and libcurl |
| 123 | better. We do however believe in a few rules when it comes to the future of |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 124 | curl: |
| 125 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 126 | * Curl is to remain a command line tool. If you want GUIs or fancy scripting |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 127 | capabilities, you're free to write another tool that uses libcurl and that |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 128 | offers this. There's no point in having a single tool that does every |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 129 | imaginable thing. That's also one of the great advantages of having the |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 130 | core of curl as a library. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 131 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 132 | * We do not add things to curl that other small and available tools already |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 133 | do very fine at the side. Curl's output is fine to pipe into another |
| 134 | program or redirect to another file for the next program to interpret. |
| 135 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 136 | * We focus on protocol related issues and improvements. If you wanna do more |
| Daniel Stenberg | 5f8e93d | 2000-10-25 07:41:58 +0000 | [diff] [blame] | 137 | magic with the supported protocols than curl currently does, chances are |
| Daniel Stenberg | 7d24ce9 | 2001-11-01 09:12:35 +0000 | [diff] [blame] | 138 | big we will agree. If you wanna add more protocols, we may very well |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 139 | agree. |
| 140 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 141 | * If you want someone else to make all the work while you wait for us to |
| 142 | implement it for you, that is not a very friendly attitude. We spend a |
| 143 | considerable time already on maintaining and developing curl. In order to |
| 144 | get more out of us, you should consider trading in some of your time and |
| 145 | efforts in return. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 146 | |
| 147 | * If you write the code, chances are bigger that it will get into curl |
| 148 | faster. |
| 149 | |
| Daniel Stenberg | a0eb52b | 2001-03-23 15:28:13 +0000 | [diff] [blame] | 150 | 1.5 Who makes cURL? |
| 151 | |
| 152 | cURL and libcurl are not made by any single individual. Sure, Daniel |
| 153 | Stenberg writes the major parts, but various people's submissions are |
| 154 | important and crucial. Anyone can post their changes and improvements and |
| 155 | have them inserted in the main sources (of course on the condition that |
| 156 | developers agree on that the fixes are good). |
| 157 | |
| Daniel Stenberg | 81f2246 | 2001-11-27 13:33:21 +0000 | [diff] [blame] | 158 | The list of contributors in the docs/THANKS file is only a small part of all |
| 159 | the people that every day provide us with bug reports, suggestions, ideas |
| 160 | and source code. |
| Daniel Stenberg | a0eb52b | 2001-03-23 15:28:13 +0000 | [diff] [blame] | 161 | |
| 162 | curl is developed by a community, with Daniel at the wheel. |
| 163 | |
| 164 | 1.6 What do you get for making cURL? |
| 165 | |
| 166 | Project cURL is entirely free and open, without any commercial interests or |
| 167 | money involved. No person gets paid in any way for developing curl. We all |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 168 | do this voluntarily on our spare time. |
| Daniel Stenberg | a0eb52b | 2001-03-23 15:28:13 +0000 | [diff] [blame] | 169 | |
| 170 | We get some help from companies. Contactor Data hosts the curl web site and |
| 171 | the main mailing list, Haxx owns the curl web site's domain and |
| 172 | sourceforge.net hosts several project tools we take advantage from like the |
| 173 | bug tracker, mailing lists and more. |
| 174 | |
| Daniel Stenberg | d370681 | 2001-11-27 13:37:29 +0000 | [diff] [blame] | 175 | If you want to support our project with a donation or similar, one way of |
| Daniel Stenberg | 25fe47f | 2001-11-14 20:13:38 +0000 | [diff] [blame] | 176 | doing that would be to buy "gift certificates" at useful online shopping |
| 177 | sites, such as amazon.com or thinkgeek.com. Another way would be to sponsor |
| 178 | us through a banner-program or by simply helping us coding, documenting, |
| 179 | testing etc. |
| Daniel Stenberg | c528dc5 | 2001-08-07 11:17:37 +0000 | [diff] [blame] | 180 | |
| 181 | 1.7 What about CURL from curl.com? |
| 182 | |
| 183 | During the summer 2001, curl.com has been busy advertising their client-side |
| 184 | programming language for the web, named CURL. |
| 185 | |
| Daniel Stenberg | 81b6ebc | 2001-08-07 18:02:37 +0000 | [diff] [blame] | 186 | We are in no way associated with curl.com or their CURL programming |
| 187 | language. |
| Daniel Stenberg | c528dc5 | 2001-08-07 11:17:37 +0000 | [diff] [blame] | 188 | |
| Daniel Stenberg | 81b6ebc | 2001-08-07 18:02:37 +0000 | [diff] [blame] | 189 | Our project name curl has been in effective use since 1998. We were not the |
| Daniel Stenberg | 4045cd5 | 2001-08-07 21:21:24 +0000 | [diff] [blame] | 190 | first computer related project to use the name "curl" and do not claim any |
| Daniel Stenberg | 81b6ebc | 2001-08-07 18:02:37 +0000 | [diff] [blame] | 191 | first-hand rights to the name. |
| Daniel Stenberg | c528dc5 | 2001-08-07 11:17:37 +0000 | [diff] [blame] | 192 | |
| Daniel Stenberg | 81b6ebc | 2001-08-07 18:02:37 +0000 | [diff] [blame] | 193 | We recognize that we will be living in parallel with curl.com and wish them |
| 194 | every success. |
| Daniel Stenberg | c528dc5 | 2001-08-07 11:17:37 +0000 | [diff] [blame] | 195 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 196 | 2. Install Related Problems |
| 197 | |
| 198 | 2.1. configure doesn't find OpenSSL even when it is installed |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 199 | |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 200 | This may be because of several reasons. |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 201 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 202 | 2.1.1. native linker doesn't find openssl |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 203 | |
| Daniel Stenberg | bfb1690 | 2000-08-17 11:42:59 +0000 | [diff] [blame] | 204 | Affected platforms: |
| 205 | Solaris (native cc compiler) |
| 206 | HPUX (native cc compiler) |
| 207 | SGI IRIX (native cc compiler) |
| Daniel Stenberg | 13962ad | 2000-09-28 10:26:44 +0000 | [diff] [blame] | 208 | SCO UNIX (native cc compiler) |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 209 | |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 210 | When configuring curl, I specify --with-ssl. OpenSSL is installed in |
| 211 | /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find |
| 212 | CRYPTO_lock in -lcrypto |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 213 | |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 214 | Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER |
| 215 | -lcrypto, so ld can't find the library. This is due to a bug in the GNU |
| 216 | autoconf tool. |
| 217 | |
| 218 | Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of |
| 219 | ./configure places the -L/usr/local/ssl/lib early enough in the command |
| 220 | line to make things work |
| 221 | |
| Daniel Stenberg | bfb1690 | 2000-08-17 11:42:59 +0000 | [diff] [blame] | 222 | Solution submitted by: Bob Allison <allisonb@users.sourceforge.net> |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 223 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 224 | 2.1.2. only the libssl lib is missing |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 225 | |
| 226 | If all include files and the libcrypto lib is present, with only the |
| 227 | libssl being missing according to configure, this is mostly likely because |
| 228 | a few functions are left out from the libssl. |
| 229 | |
| 230 | If the function names missing include RSA or RSAREF you can be certain |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 231 | that this is because libssl requires the RSA and RSAREF libs to build. |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 232 | |
| 233 | See the INSTALL file section that explains how to add those libs to |
| 234 | configure. Make sure that you remove the config.cache file before you |
| 235 | rerun configure with the new flags. |
| 236 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 237 | 2.2. Does curl work/build with other SSL libraries? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 238 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 239 | Curl has been written to use OpenSSL, although there should not be much |
| Daniel Stenberg | 26d1aac | 2001-02-16 13:41:09 +0000 | [diff] [blame] | 240 | problems using a different library. If anyone does "port" curl to use a |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 241 | different SSL library, we are of course very interested in getting the |
| 242 | patch! |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 243 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 244 | 2.3. Where can I find a copy of LIBEAY32.DLL? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 245 | |
| 246 | That is an OpenSSL binary built for Windows. |
| 247 | |
| 248 | Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 249 | on a windows machine to do https://. Check out the curl web site to find |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 250 | accurate and up-to-date pointers to recent OpenSSL DLLs and other binary |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 251 | packages. |
| 252 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 253 | 2.4. Does cURL support Socks (RFC 1928) ? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 254 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 255 | No. Nobody has wanted it that badly yet. We appreciate patches that bring |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 256 | this functionality. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 257 | |
| 258 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 259 | 3. Usage problems |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 260 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 261 | 3.1. curl: (1) SSL is disabled, https: not supported |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 262 | |
| 263 | If you get this output when trying to get anything from a https:// server, |
| 264 | it means that the configure script couldn't find all libs and include files |
| 265 | it requires for SSL to work. If the configure script fails to find them, |
| 266 | curl is simply built without SSL support. |
| 267 | |
| 268 | To get the https:// support into a curl that was previously built but that |
| 269 | reports that https:// is not supported, you should dig through the document |
| 270 | and logs and check out why the configure script doesn't find the SSL libs |
| 271 | and/or include files. |
| 272 | |
| 273 | Also, check out the other paragraph in this FAQ labeled "configure doesn't |
| 274 | find OpenSSL even when it is installed". |
| 275 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 276 | 3.2. How do I tell curl to resume a transfer? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 277 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 278 | Curl supports resumed transfers both ways on both FTP and HTTP. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 279 | |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 280 | Try the -C option. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 281 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 282 | 3.3. Why doesn't my posting using -F work? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 283 | |
| 284 | You can't simply use -F or -d at your choice. The web server that will |
| 285 | receive your post assumes one of the formats. If the form you're trying to |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 286 | "fake" sets the type to 'multipart/form-data', then and only then you must |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 287 | use the -F type. In all the most common cases, you should use -d which then |
| 288 | causes a posting with the type 'application/x-www-form-urlencoded'. |
| 289 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 290 | This is described in some detail in the MANUAL and TheArtOfHttpScripting |
| 291 | documents, and if you don't understand it the first time, read it again |
| 292 | before you post questions about this to the mailing list. Also, try reading |
| 293 | through the mailing list archives for old postings and questions regarding |
| 294 | this. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 295 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 296 | 3.4. How do I tell curl to run custom FTP commands? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 297 | |
| 298 | You can tell curl to perform optional commands both before and/or after a |
| 299 | file transfer. Study the -Q/--quote option. |
| 300 | |
| 301 | Since curl is used for file transfers, you don't use curl to just perform |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 302 | FTP commands without transferring anything. Therefore you must always specify |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 303 | a URL to transfer to/from even when doing custom FTP commands. |
| 304 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 305 | 3.5. How can I disable the Pragma: nocache header? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 306 | |
| 307 | You can change all internally generated headers by adding a replacement with |
| 308 | the -H/--header option. By adding a header with empty contents you safely |
| 309 | disable that one. Use -H "Pragma:" to disable that specific header. |
| 310 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 311 | 3.6. Does curl support javascript, ASP, XML, XHTML or HTML version Y? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 312 | |
| 313 | To curl, all contents are alike. It doesn't matter how the page was |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 314 | generated. It may be ASP, PHP, Perl, shell-script, SSI or plain |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 315 | HTML-files. There's no difference to curl and it doesn't even know what kind |
| 316 | of language that generated the page. |
| 317 | |
| 318 | Javascript is slightly different since that is code embedded in the HTML |
| 319 | that is sent for the client to interpret and curl has no javascript |
| 320 | interpreter. |
| 321 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 322 | 3.7. Can I use curl to delete/rename a file through FTP? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 323 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 324 | Yes. You specify custom FTP commands with -Q/--quote. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 325 | |
| 326 | One example would be to delete a file after you have downloaded it: |
| 327 | |
| 328 | curl -O ftp://download.com/coolfile -Q '-DELE coolfile' |
| 329 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 330 | 3.8 How do I tell curl to follow HTTP redirects? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 331 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 332 | Curl does not follow so-called redirects by default. The Location: header |
| 333 | that informs the client about this is only interpreted if you're using the |
| 334 | -L/--location option. As in: |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 335 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 336 | curl -L http://redirector.com |
| 337 | |
| Daniel Stenberg | dfdf491 | 2001-12-21 09:20:04 +0000 | [diff] [blame^] | 338 | 3.9 How do I use curl in my favourite programming language? |
| Daniel Stenberg | 368e352 | 2001-01-29 10:16:21 +0000 | [diff] [blame] | 339 | |
| Daniel Stenberg | dfdf491 | 2001-12-21 09:20:04 +0000 | [diff] [blame^] | 340 | There exist many language interfaces/bindings for curl that integrates it |
| 341 | better with various languages. If you are fluid in a script language, you |
| 342 | may very well opt to use such an interface instead of using the command line |
| 343 | tool. |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 344 | |
| 345 | At the time of writing, there are bindings for the five language mentioned |
| 346 | above, but chances are there are even more by the time you read this. Or you |
| Daniel Stenberg | cab90bf | 2001-05-30 08:01:35 +0000 | [diff] [blame] | 347 | may be able you write your own wrapper for a not-yet supported language! |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 348 | |
| 349 | Find out more about which languages that support curl directly, and how to |
| 350 | install and use them, in the libcurl section of the curl web site: |
| 351 | |
| 352 | http://curl.haxx.se/libcurl/ |
| Daniel Stenberg | 368e352 | 2001-01-29 10:16:21 +0000 | [diff] [blame] | 353 | |
| Daniel Stenberg | dfdf491 | 2001-12-21 09:20:04 +0000 | [diff] [blame^] | 354 | In December 2001, there are interfaces available for the following |
| 355 | languages: C/C++, Cocoa, Dylan, Java, Perl, PHP, Python, Rexx, Ruby, Scheme |
| 356 | and Tcl. By the time you read this, additional ones may have appeared! |
| Daniel Stenberg | 368e352 | 2001-01-29 10:16:21 +0000 | [diff] [blame] | 357 | |
| Daniel Stenberg | 147a673 | 2001-03-08 09:25:09 +0000 | [diff] [blame] | 358 | 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 359 | |
| 360 | Curl adheres to the HTTP spec, which basically means you can play with *any* |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 361 | protocol that is built on top of HTTP. Protocols such as SOAP, WEBDAV and |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 362 | XML-RPC are all such ones. You can use -X to set custom requests and -H to |
| 363 | set custom headers (or replace internally generated ones). |
| 364 | |
| 365 | Using libcurl or PHP's curl modules is just as fine and you'd just use the |
| 366 | proper library options to do the same. |
| 367 | |
| Daniel Stenberg | 88d14e9 | 2001-05-29 14:02:20 +0000 | [diff] [blame] | 368 | 3.11 How do I POST with a different Content-Type? |
| 369 | |
| 370 | You can always replace the internally generated headers with -H/--header. |
| 371 | To make a simple HTTP POST with text/xml as content-type, do something like: |
| 372 | |
| 373 | curl -d "datatopost" -H "Content-Type: text/xml" [URL] |
| 374 | |
| Daniel Stenberg | 50e9f8f | 2001-10-23 10:12:28 +0000 | [diff] [blame] | 375 | 3.12 Why do FTP specific features over HTTP proxy fail? |
| Daniel Stenberg | 7d3daa5 | 2001-10-23 10:12:00 +0000 | [diff] [blame] | 376 | |
| 377 | Because when you use a HTTP proxy, the protocol spoken on the network will |
| 378 | be HTTP, even if you specify a FTP URL. This effectively means that you |
| 379 | normally can't use FTP specific features such as ftp upload and ftp quote |
| 380 | etc. |
| 381 | |
| 382 | There is one exception to this rule, and that is if you can "tunnel through" |
| Daniel Stenberg | 271f96f | 2001-11-20 08:03:01 +0000 | [diff] [blame] | 383 | the given HTTP proxy. Proxy tunneling is enabled with a special option (-p) |
| Daniel Stenberg | 97a8c98 | 2001-12-21 08:10:34 +0000 | [diff] [blame] | 384 | and is generally not available as proxy admins usually disable tunneling to |
| Daniel Stenberg | 7d3daa5 | 2001-10-23 10:12:00 +0000 | [diff] [blame] | 385 | other ports than 443 (which is used for HTTPS access through proxies). |
| 386 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 387 | 4. Running Problems |
| 388 | |
| 389 | 4.1. Problems connecting to SSL servers. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 390 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 391 | It took a very long time before we could sort out why curl had problems to |
| 392 | connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. The |
| 393 | error sometimes showed up similar to: |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 394 | |
| 395 | 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233: |
| 396 | |
| 397 | It turned out to be because many older SSL servers don't deal with SSLv3 |
| 398 | requests properly. To correct this problem, tell curl to select SSLv2 from |
| 399 | the command line (-2/--sslv2). |
| 400 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 401 | There has also been examples where the remote server didn't like the SSLv2 |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 402 | request and instead you had to force curl to use SSLv3 with -3/--sslv3. |
| 403 | |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 404 | 4.2. Why do I get problems when I use & or % in the URL? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 405 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 406 | In general unix shells, the & letter is treated special and when used, it |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 407 | runs the specified command in the background. To safely send the & as a part |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 408 | of a URL, you should quote the entire URL by using single (') or double (") |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 409 | quotes around it. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 410 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 411 | An example that would invoke a remote CGI that uses &-letters could be: |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 412 | |
| Daniel Stenberg | edcd5df | 2000-06-06 14:13:36 +0000 | [diff] [blame] | 413 | curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl' |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 414 | |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 415 | In win32, the standard DOS shell treats the %-letter specially and you may |
| 416 | need to quote the string properly when % is used in it. |
| 417 | |
| Daniel Stenberg | 1b77c18 | 2001-01-29 10:24:51 +0000 | [diff] [blame] | 418 | Also note that if you want the literal %-letter to be part of the data you |
| 419 | pass in a POST using -d/--data you must encode it as '%25'. |
| 420 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 421 | 4.3. How can I use {, }, [ or ] to specify multiple URLs? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 422 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 423 | Because those letters have a special meaning to the shell, and to be used in |
| 424 | a URL specified to curl you must quote them. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 425 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 426 | An example that downloads two URLs (sequentially) would do: |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 427 | |
| Daniel Stenberg | edcd5df | 2000-06-06 14:13:36 +0000 | [diff] [blame] | 428 | curl '{curl,www}.haxx.se' |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 429 | |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 430 | To be able to use those letters as actual parts of the URL (without using |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 431 | them for the curl URL "globbing" system), use the -g/--globoff option (curl |
| 432 | 7.6 and later): |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 433 | |
| 434 | curl -g 'www.site.com/weirdname[].html' |
| 435 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 436 | 4.4. Why do I get downloaded data even though the web page doesn't exist? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 437 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 438 | Curl asks remote servers for the page you specify. If the page doesn't exist |
| 439 | at the server, the HTTP protocol defines how the server should respond and |
| 440 | that means that headers and a "page" will be returned. That's simply how |
| 441 | HTTP works. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 442 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 443 | By using the --fail option you can tell curl explicitly to not get any data |
| 444 | if the HTTP return code doesn't say success. |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 445 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 446 | 4.5 Why do I get return code XXX from a HTTP server? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 447 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 448 | RFC2616 clearly explains the return codes. This is a short transcript. Go |
| 449 | read the RFC for exact details: |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 450 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 451 | 4.5.1 "400 Bad Request" |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 452 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 453 | The request could not be understood by the server due to malformed |
| 454 | syntax. The client SHOULD NOT repeat the request without modifications. |
| 455 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 456 | 4.5.2 "401 Unauthorized" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 457 | |
| 458 | The request requires user authentication. |
| 459 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 460 | 4.5.3 "403 Forbidden" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 461 | |
| 462 | The server understood the request, but is refusing to fulfill it. |
| 463 | Authorization will not help and the request SHOULD NOT be repeated. |
| 464 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 465 | 4.5.4 "404 Not Found" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 466 | |
| 467 | The server has not found anything matching the Request-URI. No indication |
| 468 | is given of whether the condition is temporary or permanent. |
| 469 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 470 | 4.5.5 "405 Method Not Allowed" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 471 | |
| 472 | The method specified in the Request-Line is not allowed for the resource |
| 473 | identified by the Request-URI. The response MUST include an Allow header |
| 474 | containing a list of valid methods for the requested resource. |
| 475 | |
| Daniel Stenberg | d60029d | 2001-12-19 23:25:04 +0000 | [diff] [blame] | 476 | 4.5.6 "301 Moved Permanently" |
| 477 | |
| 478 | If you get this return code and an HTML outpt similar to this: |
| 479 | |
| 480 | <H1>Moved Permanently</H1> The document has moved <A |
| 481 | HREF="http://same_url_now_with_a_trailing_slash/">here</A>. |
| 482 | |
| 483 | it might be because you request a directory URL but without the trailing |
| 484 | slash. Try the same operation again _with_ the trailing URL, or use the |
| 485 | -L/--location option to follow the redirection. |
| 486 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 487 | 4.6. Can you tell me what error code 142 means? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 488 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 489 | All error codes that are larger than the highest documented error code means |
| Daniel Stenberg | 13bf964 | 2001-08-23 11:11:13 +0000 | [diff] [blame] | 490 | that curl has exited due to a crash. This is a serious error, and we |
| Daniel Stenberg | 25fe47f | 2001-11-14 20:13:38 +0000 | [diff] [blame] | 491 | appreciate a detailed bug report from you that describes how we could go |
| Daniel Stenberg | 13bf964 | 2001-08-23 11:11:13 +0000 | [diff] [blame] | 492 | ahead and repeat this! |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 493 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 494 | 4.7. How do I keep user names and passwords secret in Curl command lines? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 495 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 496 | This problem has two sides: |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 497 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 498 | The first part is to avoid having clear-text passwords in the command line |
| 499 | so that they don't appear in 'ps' outputs and similar. That is easily |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 500 | avoided by using the "-K" option to tell curl to read parameters from a |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 501 | file or stdin to which you can pass the secret info. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 502 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 503 | To keep the passwords in your account secret from the rest of the world is |
| 504 | not a task that curl addresses. You could of course encrypt them somehow to |
| 505 | at least hide them from being read by human eyes, but that is not what |
| 506 | anyone would call security. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 507 | |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 508 | Also note that regular HTTP and FTP passwords are sent in clear across the |
| 509 | network. All it takes for anyone to fetch them is to listen on the network. |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 510 | Eavesdropping is very easy. |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 511 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 512 | 4.8 I found a bug! |
| 513 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 514 | It is not a bug if the behavior is documented. Read the docs first. |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 515 | |
| 516 | If it is a problem with a binary you've downloaded or a package for your |
| 517 | particular platform, try contacting the person who built the package/archive |
| 518 | you have. |
| 519 | |
| 520 | If there is a bug, post a bug report in the Curl Bug Track System over at |
| Daniel Stenberg | 9012f8c | 2001-01-15 10:28:41 +0000 | [diff] [blame] | 521 | http://sourceforge.net/bugs/?group_id=976 |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 522 | |
| 523 | Always include as many details you can think of, including curl version, |
| 524 | operating system name and version and complete instructions how to repeat |
| 525 | the bug. |
| 526 | |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 527 | 4.9. Curl can't authenticate to the server that requires NTLM? |
| 528 | |
| 529 | NTLM is a Microsoft proprietary protocol. Unfortunately, curl does not |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 530 | currently support that. Proprietary formats are evil. You should not use |
| 531 | such ones. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 532 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 533 | 5. libcurl Issues |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 534 | |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 535 | 5.1. Is libcurl thread-safe? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 536 | |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 537 | Yes. |
| 538 | |
| 539 | We have written the libcurl code specificly adjusted for multi-threaded |
| 540 | programs. libcurl will use thread-safe functions instead of non-safe ones if |
| 541 | your system has such. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 542 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 543 | We would appreciate some kind of report or README file from those who have |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 544 | used libcurl in a threaded environment. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 545 | |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 546 | 5.2 How can I receive all data into a large memory chunk? |
| 547 | |
| Daniel Stenberg | a84af98 | 2001-05-15 13:09:27 +0000 | [diff] [blame] | 548 | [ See also the examples/getinmemory.c source ] |
| 549 | |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 550 | You are in full control of the callback function that gets called every time |
| 551 | there is data received from the remote server. You can make that callback do |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 552 | whatever you want. You do not have to write the received data to a file. |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 553 | |
| 554 | One solution to this problem could be to have a pointer to a struct that you |
| 555 | pass to the callback function. You set the pointer using the |
| 556 | curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to |
| 557 | the callback instead of a FILE * to a file: |
| 558 | |
| 559 | /* imaginary struct */ |
| 560 | struct MemoryStruct { |
| 561 | char *memory; |
| 562 | size_t size; |
| 563 | }; |
| 564 | |
| 565 | /* imaginary callback function */ |
| 566 | size_t |
| 567 | WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) |
| 568 | { |
| 569 | register int realsize = size * nmemb; |
| 570 | struct MemoryStruct *mem = (struct MemoryStruct *)data; |
| 571 | |
| 572 | mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); |
| 573 | if (mem->memory) { |
| 574 | memcpy(&(mem->memory[mem->size]), ptr, realsize); |
| 575 | mem->size += realsize; |
| 576 | mem->memory[mem->size] = 0; |
| 577 | } |
| 578 | return realsize; |
| 579 | } |
| 580 | |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 581 | 5.3 How do I fetch multiple files with libcurl? |
| Daniel Stenberg | ec5ac82 | 2000-12-14 08:37:09 +0000 | [diff] [blame] | 582 | |
| Daniel Stenberg | 5dd0a8a | 2001-03-06 14:37:37 +0000 | [diff] [blame] | 583 | Starting with version 7.7, curl and libcurl will have excellent support for |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 584 | transferring multiple files. You should just repeatedly set new URLs with |
| 585 | curl_easy_setopt() and then transfer it with curl_easy_perform(). The handle |
| 586 | you get from curl_easy_init() is not only reusable starting with libcurl |
| 587 | 7.7, but also you're encouraged to reuse it if you can, as that will enable |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 588 | libcurl to use persistent connections. |
| Daniel Stenberg | 5dd0a8a | 2001-03-06 14:37:37 +0000 | [diff] [blame] | 589 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 590 | For libcurl prior to 7.7, there was no multiple file support. The only |
| 591 | available way to do multiple requests was to init/perform/cleanup for each |
| 592 | transfer. |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 593 | |
| Daniel Stenberg | bc5954f | 2001-03-23 08:16:24 +0000 | [diff] [blame] | 594 | 5.4 Does libcurl do Winsock initialization on win32 systems? |
| Daniel Stenberg | 910fc85 | 2000-12-30 11:48:51 +0000 | [diff] [blame] | 595 | |
| Daniel Stenberg | 6d213e2 | 2001-11-01 14:51:02 +0000 | [diff] [blame] | 596 | Yes (since 7.8.1) if told to in the curl_global_init() call. |
| Daniel Stenberg | 910fc85 | 2000-12-30 11:48:51 +0000 | [diff] [blame] | 597 | |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 598 | 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ? |
| Daniel Stenberg | 41084e5 | 2001-01-22 08:42:00 +0000 | [diff] [blame] | 599 | |
| 600 | Yes, but you cannot open a FILE * and pass the pointer to a DLL and have |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 601 | that DLL use the FILE *. If you set CURLOPT_FILE you must also use |
| 602 | CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even |
| 603 | if that simply writes the data to the specified FILE*. Similarly, if you use |
| 604 | CURLOPT_INFILE you must also specify CURLOPT_READFUNCTION. |
| Daniel Stenberg | 41084e5 | 2001-01-22 08:42:00 +0000 | [diff] [blame] | 605 | |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 606 | (Provided by Joel DeYoung and Bob Schader) |
| Daniel Stenberg | 41084e5 | 2001-01-22 08:42:00 +0000 | [diff] [blame] | 607 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 608 | 5.6 What about Keep-Alive or persistent connections? |
| Daniel Stenberg | 6dc5c6f | 2001-01-27 20:51:31 +0000 | [diff] [blame] | 609 | |
| Daniel Stenberg | 5dd0a8a | 2001-03-06 14:37:37 +0000 | [diff] [blame] | 610 | Starting with version 7.7, curl and libcurl will have excellent support for |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 611 | persistent connections when transferring several files from the same server. |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 612 | Curl will attempt to reuse connections for all URLs specified on the same |
| 613 | command line/config file, and libcurl will reuse connections for all |
| 614 | transfers that are made using the same libcurl handle. |
| Daniel Stenberg | 5dd0a8a | 2001-03-06 14:37:37 +0000 | [diff] [blame] | 615 | |
| Daniel Stenberg | 4c48599 | 2001-04-22 15:45:27 +0000 | [diff] [blame] | 616 | Previous versions had no persistent connection support. |
| Daniel Stenberg | 6dc5c6f | 2001-01-27 20:51:31 +0000 | [diff] [blame] | 617 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 618 | 6. License Issues |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 619 | |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 620 | Curl and libcurl are released under a MIT/X derivate license *or* the MPL, |
| 621 | the Mozilla Public License. To get a really good answer to your license |
| 622 | conflict questions, you should study the MPL and MIT/X licenses and the |
| 623 | license you are about to use and check for clashes yourself. This section is |
| 624 | just a brief summary for the cases we get the most questions. (Parts of this |
| 625 | section was much enhanced by Bjorn Reese.) |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 626 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 627 | 6.1. I have a GPL program, can I use the libcurl library? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 628 | |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 629 | Yes! |
| Daniel Stenberg | 7d1ef96 | 2000-08-14 06:31:59 +0000 | [diff] [blame] | 630 | |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 631 | Since libcurl may be distributed under the MIT/X derivate license, it can be |
| 632 | used together with GPL in any software. |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 633 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 634 | 6.2. I have a closed-source program, can I use the libcurl library? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 635 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 636 | Yes! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 637 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 638 | libcurl does not put any restrictions on the program that uses the library. |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 639 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 640 | 6.3. I have a BSD licensed program, can I use the libcurl library? |
| 641 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 642 | Yes! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 643 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 644 | libcurl does not put any restrictions on the program that uses the library. |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 645 | |
| 646 | 6.4. I have a program that uses LGPL libraries, can I use libcurl? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 647 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 648 | Yes! |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 649 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 650 | The LGPL license doesn't clash with other licenses. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 651 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 652 | 6.5. Can I modify curl/libcurl for my program and keep the changes secret? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 653 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 654 | Yes! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 655 | |
| 656 | The MIT/X derivate license practically allows you to do almost anything with |
| 657 | the sources, on the condition that the copyright texts in the sources are |
| 658 | left intact. |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 659 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 660 | 6.6. Can you please change the curl/libcurl license to XXXX? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 661 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame] | 662 | No. |
| 663 | |
| Daniel Stenberg | 11d718b | 2001-03-13 11:47:30 +0000 | [diff] [blame] | 664 | We have carefully picked this license after years of development and |
| 665 | discussions and a large amount of people have contributed with source code |
| 666 | knowing that this is the license we use. This license puts the restrictions |
| 667 | we want on curl/libcurl and it does not spread to other programs or |
| 668 | libraries that use it. The recent dual license modification should make it |
| 669 | possible for everyone to use libcurl or curl in their projects, no matter |
| 670 | what license they already have in use. |