big last-beta (?) cleanup commit
This commit is contained in:
145
docs/FAQ
145
docs/FAQ
@@ -121,106 +121,139 @@ FAQ
|
||||
|
||||
9. Why do I get problems when I use & in the URL?
|
||||
|
||||
In general unix shells, the & letter is treated special and when used it
|
||||
runs the specified command in the background. To safely send the & as a
|
||||
part of a URL, you should qoute the entire URL by using single (') or
|
||||
double (") quotes around it.
|
||||
In general unix shells, the & letter is treated special and when used it
|
||||
runs the specified command in the background. To safely send the & as a part
|
||||
of a URL, you should qoute the entire URL by using single (') or double (")
|
||||
quotes around it.
|
||||
|
||||
An example that would invoke a remote CGI that uses &-letters could be:
|
||||
An example that would invoke a remote CGI that uses &-letters could be:
|
||||
|
||||
curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
|
||||
|
||||
10. How can I use {, }, [ or ] to specify multiple URLs?
|
||||
|
||||
Because those letters have a special meaning to the shell, and to be used
|
||||
in a URL specified to curl you must quote them.
|
||||
Because those letters have a special meaning to the shell, and to be used in
|
||||
a URL specified to curl you must quote them.
|
||||
|
||||
An example that downloads two URLs (sequentially) would do:
|
||||
An example that downloads two URLs (sequentially) would do:
|
||||
|
||||
curl '{curl,www}.haxx.se'
|
||||
|
||||
11. Where can I find a copy of LIBEAY32.DLL?
|
||||
|
||||
That is an OpenSSL binary built for Windows.
|
||||
That is an OpenSSL binary built for Windows.
|
||||
|
||||
Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs
|
||||
on a windows machine to do https://. Check out the curl web page to find
|
||||
accurate and up-to-date pointers to recent OpenSSL DDLs and other binary
|
||||
packages.
|
||||
Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs
|
||||
on a windows machine to do https://. Check out the curl web page to find
|
||||
accurate and up-to-date pointers to recent OpenSSL DDLs and other binary
|
||||
packages.
|
||||
|
||||
12. Why do I get downloaded data even though the web page doesn't exist?
|
||||
|
||||
Curl asks remote servers for the page you specify. If the page doesn't
|
||||
exist at the server, the HTTP protocol defines how the server should
|
||||
respond and that means that headers and a "page" will be returned. That's
|
||||
simply how HTTP works.
|
||||
Curl asks remote servers for the page you specify. If the page doesn't exist
|
||||
at the server, the HTTP protocol defines how the server should respond and
|
||||
that means that headers and a "page" will be returned. That's simply how
|
||||
HTTP works.
|
||||
|
||||
By using the --fail option you can tell curl explicitly to not get any data
|
||||
if the HTTP return code doesn't say success.
|
||||
By using the --fail option you can tell curl explicitly to not get any data
|
||||
if the HTTP return code doesn't say success.
|
||||
|
||||
13. Why do I get "HTTP/1.1 403 Forbidden" from a http server?
|
||||
|
||||
RFC2616 clearly explains this return code:
|
||||
RFC2616 clearly explains this return code:
|
||||
|
||||
10.4.4 403 Forbidden
|
||||
10.4.4 403 Forbidden
|
||||
|
||||
The server understood the request, but is refusing to fulfill it.
|
||||
Authorization will not help and the request SHOULD NOT be repeated.
|
||||
If the request method was not HEAD and the server wishes to make
|
||||
public why the request has not been fulfilled, it SHOULD describe the
|
||||
reason for the refusal in the entity. If the server does not wish to
|
||||
make this information available to the client, the status code 404
|
||||
(Not Found) can be used instead.
|
||||
The server understood the request, but is refusing to fulfill it.
|
||||
Authorization will not help and the request SHOULD NOT be repeated. If the
|
||||
request method was not HEAD and the server wishes to make public why the
|
||||
request has not been fulfilled, it SHOULD describe the reason for the
|
||||
refusal in the entity. If the server does not wish to make this information
|
||||
available to the client, the status code 404 (Not Found) can be used
|
||||
instead.
|
||||
|
||||
14. How can I disable the Pragma: nocache header?
|
||||
|
||||
You can change all internally generated headers by adding a replacement
|
||||
with the -H/--header option. By adding a header with empty contents you
|
||||
safelt disables the headers. Use -H "Pragma:" to disable that specific
|
||||
header.
|
||||
You can change all internally generated headers by adding a replacement with
|
||||
the -H/--header option. By adding a header with empty contents you safelt
|
||||
disables the headers. Use -H "Pragma:" to disable that specific header.
|
||||
|
||||
15. Can you tell me what error code 142 means?
|
||||
|
||||
All error codes that are larger than the highest documented error code
|
||||
means that curl has existed due to a timeout. There is currentl no nice way
|
||||
for curl to abort from such a condition and that's why it gets this
|
||||
undocumented error. This is planned to change in a future release.
|
||||
All error codes that are larger than the highest documented error code means
|
||||
that curl has existed due to a timeout. There is currentl no nice way for
|
||||
curl to abort from such a condition and that's why it gets this undocumented
|
||||
error. This is planned to change in a future release.
|
||||
|
||||
16. How do I keep usernames and passwords secret in Curl command lines?
|
||||
|
||||
I see this problem as two parts:
|
||||
I see this problem as two parts:
|
||||
|
||||
The first part is to avoid having clear-text passwords in the command line
|
||||
so that they don't appear in 'ps' outputs and similar. That is easily
|
||||
avoided by using the "-K" option that tells curl to read parameters from a
|
||||
file or stdin to which you can pass the secret info.
|
||||
The first part is to avoid having clear-text passwords in the command line
|
||||
so that they don't appear in 'ps' outputs and similar. That is easily
|
||||
avoided by using the "-K" option tho tell curl to read parameters from a
|
||||
file or stdin to which you can pass the secret info.
|
||||
|
||||
To keep the passwords in your account secret from the rest of the world is
|
||||
not a task that curl addresses. You could of course encrypt them somehow to
|
||||
at least hide them from being read by human eyes, but that is not what
|
||||
anyone would call security.
|
||||
To keep the passwords in your account secret from the rest of the world is
|
||||
not a task that curl addresses. You could of course encrypt them somehow to
|
||||
at least hide them from being read by human eyes, but that is not what
|
||||
anyone would call security.
|
||||
|
||||
17. Does curl support javascript, ASP, XML, XHTML or HTML version Y?
|
||||
|
||||
To curl, all contents are alike. It doesn't matter how the page was
|
||||
generated. It may be ASP, PHP, perl, shell-script, SSI or plain
|
||||
HTML-files. There's no difference to curl and it doesn't even know what
|
||||
kind of language that generated the page.
|
||||
To curl, all contents are alike. It doesn't matter how the page was
|
||||
generated. It may be ASP, PHP, perl, shell-script, SSI or plain
|
||||
HTML-files. There's no difference to curl and it doesn't even know what kind
|
||||
of language that generated the page.
|
||||
|
||||
Javascript is slightly different since that is code embedded in the HTML
|
||||
that is sent for the client to interpret and curl has no javascript
|
||||
interpreter.
|
||||
Javascript is slightly different since that is code embedded in the HTML
|
||||
that is sent for the client to interpret and curl has no javascript
|
||||
interpreter.
|
||||
|
||||
18. Does cURL support Socks (RFC 1928) ?
|
||||
|
||||
No. Nobody has wanted it that badly yet. I would appriciate patches that
|
||||
brings this functionality.
|
||||
No. Nobody has wanted it that badly yet. I would appriciate patches that
|
||||
brings this functionality.
|
||||
|
||||
19. Can I use curl to delete/rename a file through FTP?
|
||||
|
||||
Yes. You specify custom ftp commands with -Q/--quote.
|
||||
Yes. You specify custom ftp commands with -Q/--quote.
|
||||
|
||||
One example would be to delete a file after you have downloaded it:
|
||||
One example would be to delete a file after you have downloaded it:
|
||||
|
||||
curl -O ftp://download.com/coolfile -Q '-DELE coolfile'
|
||||
|
||||
20. Can I use curl/libcurl in my program licensed under XXX?
|
||||
|
||||
Curl and libcurl are released under the MPL, the Mozilla Public License. To
|
||||
get a really good answer to this or other licensing questions, you should
|
||||
study the MPL license and the license you are about to use and check for
|
||||
clashes yourself. This is a brief summary for a few cases for which we get
|
||||
questions:
|
||||
|
||||
I have a GPL program, can I use the libcurl library?
|
||||
|
||||
No. GPL'd software requires all parts of the final executable to be
|
||||
licensed under GPL.
|
||||
|
||||
I have a closed-source program, can I use the libcurl library?
|
||||
|
||||
Yes, libcurl does not put any restrictions on the program that uses the
|
||||
library. If you end up doing changes to the library, only those changes
|
||||
must be made available, not the ones to your program.
|
||||
|
||||
I have a program that uses LGPL libraries, can I use libcurl?
|
||||
|
||||
Yes you can. LGPL libraries don't spread to other libraries the same way
|
||||
GPL ones do.
|
||||
|
||||
Can I modify curl/libcurl for my own program and keep the changes secret?
|
||||
|
||||
No, you're not allowed to do that.
|
||||
|
||||
Can you please change the curl/libcurl license to XXXX?
|
||||
|
||||
No. We carefully picked this license years ago and a large amount of
|
||||
people have contributed with source code knowing that this is the license
|
||||
we use. This license puts the restrictions we want on curl/libcurl and it
|
||||
does not spread to other programs or libraries.
|
||||
|
||||
Reference in New Issue
Block a user