Sortix 1.1dev ports manual
This manual documents Sortix 1.1dev ports. You can instead view this document in the latest official manual.
CURLOPT_URL(3) | curl_easy_setopt options | CURLOPT_URL(3) |
NAME
CURLOPT_URL - provide the URL to use in the requestSYNOPSIS
#include <curl/curl.h>DESCRIPTION
Pass in a pointer to the URL to work with. The parameter should be a char * to a zero terminated string which must be URL-encoded in the following format:- HTTP
- The path part of an HTTP request specifies the file to
retrieve and from what directory. If the directory is not specified then
the web server's root directory is used. If the file is omitted then the
default document will be retrieved for either the directory specified or
the root directory. The exact resource returned for each URL is entirely
dependent on the server's configuration.
- FTP
- The path part of an FTP request specifies the file to
retrieve and from what directory. If the file part is omitted then libcurl
downloads the directory listing for the directory specified. If the
directory is omitted then the directory listing for the root / home
directory will be returned.
- SMTP
- The path part of a SMTP request specifies the host name to
present during communication with the mail server. If the path is omitted
then libcurl will attempt to resolve the local computer's host name.
However, this may not return the fully qualified domain name that is
required by some mail servers and specifying this path allows you to set
an alternative name, such as your machine's fully qualified domain name,
which you might have obtained from an external function such as
gethostname or getaddrinfo.
- POP3
- The path part of a POP3 request specifies the message ID to
retrieve. If the ID is not specified then a list of waiting messages is
returned instead.
- IMAP
- The path part of an IMAP request not only specifies the
mailbox to list (Added in 7.30.0) or select, but can also be used to check
the UIDVALIDITY of the mailbox, to specify the UID, SECTION (Added in
7.30.0) and PARTIAL octets (Added in 7.37.0) of the message to fetch and
to specify what messages to search for (Added in 7.37.0).
- SCP
- The path part of a SCP request specifies the file to
retrieve and from what directory. The file part may not be omitted. The
file is taken as an absolute path from the root directory on the server.
To specify a path relative to the user's home directory on the server,
prepend ~/ to the path portion. If the user name is not embedded in the
URL, it can be set with the CURLOPT_USERPWD(3) or
CURLOPT_USERNAME(3) option.
- SFTP
- The path part of a SFTP request specifies the file to
retrieve and from what directory. If the file part is omitted then libcurl
downloads the directory listing for the directory specified. If the path
ends in a / then a directory listing is returned instead of a file. If the
path is omitted entirely then the directory listing for the root / home
directory will be returned. If the user name is not embedded in the URL,
it can be set with the CURLOPT_USERPWD(3) or
CURLOPT_USERNAME(3) option.
- SMB
- The path part of a SMB request specifies the file to
retrieve and from what share and directory or the share to upload to and
as such, may not be omitted. If the user name is not embedded in the URL,
it can be set with the CURLOPT_USERPWD(3) or
CURLOPT_USERNAME(3) option. If the user name is embedded in the URL
then it must contain the domain name and as such, the backslash must be
URL encoded as %2f.
- LDAP
- The path part of a LDAP request can be used to specify the:
Distinguished Name, Attributes, Scope, Filter and Extension for a LDAP
search. Each field is separated by a question mark and when that field is
not required an empty string with the question mark separator should be
included.
- RTMP
- There's no official URL spec for RTMP so libcurl uses the
URL syntax supported by the underlying librtmp library. It has a syntax
where it wants a traditional URL, followed by a space and a series of
space-separated name=value pairs.
The application does not have to keep the
string around after setting this option.
ENCODING
The string pointed to in the CURLOPT_URL(3) argument is generally expected to be a sequence of characters using an ASCII compatible encoding.DEFAULT
There is no default URL. If this option isn't set, no transfer can be performed.SECURITY CONCERNS
Applications may at times find it convenient to allow users to specify URLs for various purposes and that string would then end up fed to this option.PROTOCOLS
AllEXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_perform(curl); }
AVAILABILITY
POP3 and SMTP were added in 7.31.0RETURN VALUE
Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient heap space.SEE ALSO
CURLOPT_VERBOSE(3), CURLOPT_PROTOCOLS(3), CURLOPT_FORBID_REUSE(3), CURLOPT_FRESH_CONNECT(3), curl_easy_perform(3), CURLINFO_REDIRECT_URL(3), CURLOPT_PATH_AS_IS(3), CURLOPT_CURLU(3),December 18, 2019 | libcurl 7.69.0 |