Docu review done: Mon 06 May 2024 09:19:51 AM CEST
curl
Table of content
Commands
Commands | Description |
---|---|
curl -I [url] | shows only security headers |
curl -k [url] | (TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure. |
curl -A "[uer-agent-name]" [url] | changes user agent |
curl -H "User-Agent: [uer-agent-name]" [url] | changes user agent |
curl [-f/--fail] [url] | lets curl exit with none 0 returncode on failed actions (returncode 22 will be used instead) |
curl --fail-early [url] | Fail and exit on the first detected transfer error. |
curl --fail-with-body [url] | Return an error on server errors where the HTTP response code is 400 or greater |
Addition to
-f
,--fail
parameterThis method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes
401
and407
).Note
-f
,--fail
is not global and is therefore contained by-:
,--next
Addition to
--fail-early
parameterUsing this option,
curl
will instead return an error on the first transfer that fails, independent of the amount of URLs that are given on the command line. This way, no transfer failures go undetected by scripts and similar.This option is global and does not need to be specified for each use of
-:
,--next
.
Addition to
--fail-with-body
parameterThis is an alternative option to
-f
,--fail
which makescurl
fail for the same circumstances but without saving the content.
Exit codes
can be found in man page as well ;)
- Unsupported protocol. This build of
curl
has no support for this protocol. - Failed to initialize.
- URL malformed. The syntax was not correct.
- A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. To make
curl
able to do this, you probably need another build oflibcurl
! - Couldn’t resolve proxy. The given proxy host could not be resolved.
- Couldn’t resolve host. The given remote host was not resolved.
- Failed to connect to host.
- Weird server reply. The server sent data
curl
couldn’t parse. - FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that doesn’t exist on the server.
- FTP accept failed. While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar.
- FTP weird PASS reply.
curl
couldn’t parse the reply sent to the PASS request. - During an active FTP session while waiting for the server to connect back to
curl
, the timeout expired. - FTP weird PASV reply,
curl
couldn’t parse the reply sent to the PASV request. - FTP weird 227 format.
curl
couldn’t parse the 227-line the server sent. - FTP can’t get host. Couldn’t resolve the host IP we got in the 227-line.
- HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error message for details.
- FTP couldn’t set binary. Couldn’t change transfer method to binary.
- Partial file. Only a part of the file was transferred.
- FTP couldn’t download/access the given file, the RETR (or similar) command failed.
- FTP quote error. A quote command returned error from the server.
- HTTP page not retrieved. The requested url was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if
-f
,--fail
is used. - Write error.
curl
couldn’t write data to a local filesystem or similar. - FTP couldn’t STOR file. The server denied the STOR operation, used for FTP uploading.
- Read error. Various reading problems.
- Out of memory. A memory allocation request failed.
- Operation timeout. The specified time-out period was reached according to the conditions.
- FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead!
- FTP couldn’t use REST. The REST command failed. This command is used for resumed FTP transfers.
- HTTP range error. The range “command” didn’t work.
- HTTP post error. Internal post-request generation error.
- SSL connect error. The SSL handshaking failed.
- Bad download resume. Couldn’t continue an earlier aborted download.
- FILE couldn’t read file. Failed to open the file. Permissions?
- LDAP cannot bind. LDAP bind operation failed.
- LDAP search failed.
- Function not found. A required LDAP function was not found.
- Aborted by callback. An application told
curl
to abort the operation. - Internal error. A function was called with a bad parameter.
- Interface error. A specified outgoing interface could not be used.
- Too many redirects. When following redirects,
curl
hit the maximum amount. - Unknown option specified to
libcurl
. This indicates that you passed a weird option tocurl
that was passed on tolibcurl
and rejected. Read up in the manual! - Malformed telnet option.
- The peer’s SSL certificate or SSH MD5 fingerprint was not OK.
- The server didn’t reply anything, which here is considered an error.
- SSL crypto engine not found.
- Cannot set SSL crypto engine as default.
- Failed sending network data.
- Failure in receiving network data.
- Problem with the local certificate.
- Couldn’t use specified SSL cipher.
- Peer certificate cannot be authenticated with known CA certificates.
- Unrecognized transfer encoding.
- Invalid LDAP URL.
- Maximum file size exceeded.
- Requested FTP SSL level failed.
- Sending the data requires a rewind that failed.
- Failed to initialise SSL Engine.
- The user name, password, or similar was not accepted and
curl
failed to log in. - File not found on TFTP server.
- Permission problem on TFTP server.
- Out of disk space on TFTP server.
- Illegal TFTP operation.
- Unknown TFTP transfer ID.
- File already exists (TFTP).
- No such user (TFTP).
- Character conversion failed.
- Character conversion functions required.
- Problem with reading the SSL CA cert (path? access rights?).
- The resource referenced in the URL does not exist.
- An unspecified error occurred during the SSH session.
- Failed to shut down the SSL connection.
- Could not load CRL file, missing or wrong format (added in 7.19.0).
- Issuer check failed (added in 7.19.0).
- The FTP PRET command failed
- RTSP: mismatch of CSeq numbers
- RTSP: mismatch of Session Identifiers
- unable to parse FTP file list
- FTP chunk callback reported error
- No connection available, the session will be queued
- SSL public key does not matched pinned public key
- Invalid SSL certificate status.
- Stream error in HTTP/2 framing layer.
- An API function was called from inside a callback.
- An authentication function returned an error.
- A problem was detected in the HTTP/3 layer. This is somewhat generic and can be one out of several problems, see the error message for details.
- QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers. XX. More error codes will appear here in future releases. The existing ones are meant to never change.