CURLOPT_ALTSVC |
Pass the filename for cURL to use as the Alt-Svc cache file to read existing cache contents from and
possibly also write it back to a after a transfer, unless CURLALTSVC_READONLYFILE
is set via CURLOPT_ALTSVC_CTRL .
|
|
CURLOPT_ALTSVC_CTRL |
Populate the bitmask with the correct set of features to instruct cURL how to handle Alt-Svc for the
transfers using this handle. cURL only accepts Alt-Svc headers over HTTPS. It will also only complete
a request to an alternative origin if that origin is properly hosted over HTTPS.
Setting any bit will enable the alt-svc engine. The options are:
CURLALTSVC_H1 ,
CURLALTSVC_H2 ,
CURLALTSVC_H3 , and
CURLALTSVC_READONLYFILE .
|
|
CURLOPT_AWS_SIGV4 |
Provides AWS V4 signature authentication on HTTP(S) header.
This option overrides any other authentication types that have been set in
CURLOPT_HTTPAUTH . This method cannot be combined with other authentication types.
|
|
CURLOPT_CAINFO |
一个保存着1个或多个用来让服务端验证的证书的文件名。这个参数仅仅在和CURLOPT_SSL_VERIFYPEER 一起使用时才有意义。 .
|
可能需要绝对路径。
|
CURLOPT_CAINFO_BLOB |
The name of a PEM file holding one or more certificates to verify the
peer with. This option overrides CURLOPT_CAINFO .
|
Available as of PHP 8.2.0 and cURL 7.77.0
|
CURLOPT_CAPATH |
一个保存着多个CA证书的目录。这个选项是和CURLOPT_SSL_VERIFYPEER 一起使用的。
|
|
CURLOPT_COOKIE |
设定 HTTP 请求中"Cookie: " 部分的内容。多个 cookie 用分号分隔,分号后带一个空格(例如, "fruit=apple; colour=red ")。
|
|
CURLOPT_COOKIEFILE |
包含 cookie 数据的文件名,cookie 文件的格式可以是 Netscape 格式,或者只是纯 HTTP 头部风格,存入文件。如果文件名是空的,不会加载 cookie,但 cookie 的处理仍旧启用。
|
|
CURLOPT_COOKIEJAR |
连接结束后,比如,调用 curl_close 后,保存 cookie 信息的文件。
|
|
CURLOPT_COOKIELIST |
cookie 字符串(即 Netscape/Mozilla 的单行格式,或常规 HTTP 样式的 Set-Cookie 头)将单个 cookie 添加到内部 cookie 存储中。
"ALL" 擦除内存中保存的所有 cookie。
"SESS" 擦除内存中保存的所有会话 cookie。
"FLUSH" 将所有已知的 cookie 写入到 CURLOPT_COOKIEJAR 指定的文件。
"RELOAD" 从 CURLOPT_COOKIEFILE 指定的文件中加载所有 cookie。
|
自 cURL 7.14.1 起可用。
|
CURLOPT_CUSTOMREQUEST |
HTTP 请求时,使用自定义的 Method 来代替"GET" 或"HEAD" 。对 "DELETE" 或者其他更隐蔽的 HTTP 请求有用。
有效值如 "GET" ,"POST" ,"CONNECT" 等等;也就是说,不要在这里输入整行 HTTP 请求。例如输入"GET /index.html HTTP/1.0\r\n\r\n" 是不正确的。
注意:
不确定服务器支持这个自定义方法则不要使用它。
|
|
CURLOPT_DEFAULT_PROTOCOL |
URL不带协议的时候,使用的默认协议。
|
cURL 7.45.0 中添加,自 PHP 7.0.7 起有效。
|
CURLOPT_DNS_INTERFACE |
Set the name of the network interface that the DNS resolver should bind to.
This must be an interface name (not an address).
|
Added in cURL 7.33.0. Available since PHP 7.0.7.
|
CURLOPT_DNS_LOCAL_IP4 |
Set the local IPv4 address that the resolver should bind to. The argument
should contain a single numerical IPv4 address as a string.
|
Added in cURL 7.33.0. Available since PHP 7.0.7.
|
CURLOPT_DNS_LOCAL_IP6 |
Set the local IPv6 address that the resolver should bind to. The argument
should contain a single numerical IPv6 address as a string.
|
Added in cURL 7.33.0. Available since PHP 7.0.7.
|
CURLOPT_EGDSOCKET |
类似CURLOPT_RANDOM_FILE ,除了一个Entropy Gathering Daemon套接字。
|
|
CURLOPT_ENCODING |
HTTP请求头中"Accept-Encoding: " 的值。
这使得能够解码响应的内容。
支持的编码有"identity" ,"deflate" 和"gzip" 。如果为空字符串"" ,会发送所有支持的编码类型。
|
在 cURL 7.10 中被加入。
|
CURLOPT_FTPPORT |
这个值将被用来获取供FTP"PORT"指令所需要的IP地址。
"PORT" 指令告诉远程服务器连接到我们指定的IP地址。这个字符串可以是纯文本的IP地址、主机名、一个网络接口名(UNIX下)或者只是一个'-'来使用默认的 IP 地址。
|
|
CURLOPT_HSTS |
HSTS (HTTP Strict Transport Security) cache file name.
|
|
CURLOPT_HSTS_CTRL |
Controls HSTS (HTTP Strict Transport Security) behavior. Populate the bitmask with the correct set of
features to instruct cURL how to handle HSTS for the transfers using this handle.
CURLHSTS_ENABLE enables the in-memory HSTS cache. If the HSTS cache file is defined,
set CURLHSTS_READONLYFILE to make the file read-only.
|
|
CURLOPT_INTERFACE |
发送的网络接口(interface),可以是一个接口名、IP 地址或者是一个主机名。
|
|
CURLOPT_KEYPASSWD |
使用 CURLOPT_SSLKEY
或 CURLOPT_SSH_PRIVATE_KEYFILE 私钥时候的密码。
|
在 cURL 7.16.1 中添加。
|
CURLOPT_KRB4LEVEL |
KRB4 (Kerberos 4) 安全级别。下面的任何值都是有效的(从低到高的顺序):"clear" 、"safe" 、"confidential" 、"private". 。如果字符串以上这些,将使用"private" 。
这个选项设置为 null 时将禁用 KRB4 安全认证。目前 KRB4 安全认证只能用于 FTP 传输。
|
|
CURLOPT_LOGIN_OPTIONS |
Can be used to set protocol specific login options, such as the
preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*",
and should be used in conjunction with the
CURLOPT_USERNAME option.
|
Added in cURL 7.34.0. Available since PHP 7.0.7.
|
CURLOPT_PINNEDPUBLICKEY |
Set the pinned public key.
The string can be the file name of your pinned public key. The file
format expected is "PEM" or "DER". The string can also be any
number of base64 encoded sha256 hashes preceded by "sha256//" and
separated by ";".
|
Added in cURL 7.39.0. Available since PHP 7.0.7.
|
CURLOPT_POSTFIELDS |
在 HTTP “POST”操作中要发送的所有数据。
这个参数可以是 urlencoded 后的字符串,类似'para1=val1¶2=val2&... ',也可以使用一个以字段名为键值,字段数据为值的数组。
如果value 是一个数组,Content-Type 头将会被设置成multipart/form-data 。
可以使用 CURLFile 或 CURLStringFile 发送文件,在这种情况下,value 必须是数组。
|
|
CURLOPT_PRIVATE |
Any data that should be associated with this cURL handle. This data
can subsequently be retrieved with the
CURLINFO_PRIVATE option of
curl_getinfo(). cURL does nothing with this data.
When using a cURL multi handle, this private data is typically a
unique key to identify a standard cURL handle.
|
Added in cURL 7.10.3.
|
CURLOPT_PRE_PROXY |
Set a string holding the host name or dotted numerical
IP address to be used as the preproxy that curl connects to before
it connects to the HTTP(S) proxy specified in the
CURLOPT_PROXY option for the upcoming request.
The preproxy can only be a SOCKS proxy and it should be prefixed with
[scheme]:// to specify which kind of socks is used.
A numerical IPv6 address must be written within [brackets].
Setting the preproxy to an empty string explicitly disables the use of a preproxy.
To specify port number in this string, append :[port]
to the end of the host name. The proxy's port number may optionally be
specified with the separate option CURLOPT_PROXYPORT .
Defaults to using port 1080 for proxies if a port is not specified.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY |
HTTP 代理通道。
|
|
CURLOPT_PROXY_SERVICE_NAME |
代理验证服务的名称。
|
在 cURL 7.43.0 中添加了 HTTP 代理,在 cURL 7.49.0 中添加了 SOCKS5 代理。自 PHP 7.0.7 起可用。
|
CURLOPT_PROXY_CAINFO |
The path to proxy Certificate Authority (CA) bundle. Set the path as a
string naming a file holding one or more certificates to
verify the HTTPS proxy with.
This option is for connecting to an HTTPS proxy, not an HTTPS server.
Defaults set to the system path where libcurl's cacert bundle is assumed
to be stored.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_CAINFO_BLOB |
The name of a PEM file holding one or more certificates to verify the HTTPS proxy with.
This option is for connecting to an HTTPS proxy, not an HTTPS server.
Defaults set to the system path where libcurl's cacert bundle is assumed
to be stored.
|
Available as of PHP 8.2.0 and libcurl >= cURL 7.77.0.
|
CURLOPT_PROXY_CAPATH |
The directory holding multiple CA certificates to verify the HTTPS proxy with.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_CRLFILE |
Set the file name with the concatenation of CRL (Certificate Revocation List)
in PEM format to use in the certificate validation that occurs during
the SSL exchange.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_KEYPASSWD |
Set the string be used as the password required to use the
CURLOPT_PROXY_SSLKEY private key. You never needed a
passphrase to load a certificate but you need one to load your private key.
This option is for connecting to an HTTPS proxy, not an HTTPS server.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_PINNEDPUBLICKEY |
Set the pinned public key for HTTPS proxy. The string can be the file name
of your pinned public key. The file format expected is "PEM" or "DER".
The string can also be any number of base64 encoded sha256 hashes preceded by
"sha256//" and separated by ";"
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_SSLCERT |
The file name of your client certificate used to connect to the HTTPS proxy.
The default format is "P12" on Secure Transport and "PEM" on other engines,
and can be changed with CURLOPT_PROXY_SSLCERTTYPE .
With NSS or Secure Transport, this can also be the nickname of the certificate
you wish to authenticate with as it is named in the security database.
If you want to use a file from the current directory, please precede it with
"./" prefix, in order to avoid confusion with a nickname.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_SSLCERTTYPE |
The format of your client certificate used when connecting to an HTTPS proxy.
Supported formats are "PEM" and "DER", except with Secure Transport.
OpenSSL (versions 0.9.3 and later) and Secure Transport
(on iOS 5 or later, or OS X 10.7 or later) also support "P12" for
PKCS#12-encoded files. Defaults to "PEM".
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_SSL_CIPHER_LIST |
The list of ciphers to use for the connection to the HTTPS proxy.
The list must be syntactically correct, it consists of one or more cipher
strings separated by colons. Commas or spaces are also acceptable separators
but colons are normally used, !, - and + can be used as operators.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_TLS13_CIPHERS |
The list of cipher suites to use for the TLS 1.3 connection to a proxy.
The list must be syntactically correct, it consists of one or more
cipher suite strings separated by colons. This option is currently used
only when curl is built to use OpenSSL 1.1.1 or later.
If you are using a different SSL backend you can try setting
TLS 1.3 cipher suites by using the CURLOPT_PROXY_SSL_CIPHER_LIST option.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.61.0 起可用。使用 OpenSSL >= 1.1.1 编译时可用。
|
CURLOPT_PROXY_SSLKEY |
The file name of your private key used for connecting to the HTTPS proxy.
The default format is "PEM" and can be changed with
CURLOPT_PROXY_SSLKEYTYPE .
(iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。如果启用内置 TLS,则可用。
|
CURLOPT_PROXY_SSLKEYTYPE |
The format of your private key. Supported formats are "PEM", "DER" and "ENG".
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_TLSAUTH_PASSWORD |
The password to use for the TLS authentication method specified with the
CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the
CURLOPT_PROXY_TLSAUTH_USERNAME option to also be set.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_TLSAUTH_TYPE |
The method of the TLS authentication used for the HTTPS connection. Supported method is "SRP".
注意:
Secure Remote Password (SRP) authentication for TLS provides mutual authentication
if both sides have a shared secret. To use TLS-SRP, you must also set the
CURLOPT_PROXY_TLSAUTH_USERNAME and
CURLOPT_PROXY_TLSAUTH_PASSWORD options.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXY_TLSAUTH_USERNAME |
The username to use for the HTTPS proxy TLS authentication method specified with the
CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the
CURLOPT_PROXY_TLSAUTH_PASSWORD option to also be set.
|
自 PHP 7.3.0 和 libcurl >= cURL 7.52.0 起可用。
|
CURLOPT_PROXYUSERPWD |
一个用来连接到代理的 "[username]:[password]" 格式的字符串。
|
|
CURLOPT_RANDOM_FILE |
一个被用来生成 SSL 随机数种子的文件名。
|
|
CURLOPT_RANGE |
以"X-Y" 的形式,其中X和Y都是可选项获取数据的范围,以字节计。HTTP传输线程也支持几个这样的重复项中间用逗号分隔如"X-Y,N-M" 。
|
|
CURLOPT_REFERER |
在HTTP请求头中"Referer: " 的内容。
|
|
CURLOPT_SASL_AUTHZID |
The authorization identity (authzid) for the transfer. Only applicable to the PLAIN SASL
authentication mechanism where it is optional. When not specified, only the authentication identity
(authcid) as specified by the username will be sent to the server, along with the password.
The server will derive the authzid from the authcid when not provided, which it will then use internally.
|
|
CURLOPT_SERVICE_NAME |
验证服务的名称
|
cURL 7.43.0 起添加,自 PHP 7.0.7 有效。
|
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 |
包含 32 位长的 16 进制数值。这个字符串应该是远程主机公钥(public key) 的 MD5 校验值。在不匹配的时候 libcurl 会拒绝连接。
此选项仅用于 SCP 和 SFTP 的传输。
|
cURL 7.17.1 中添加。
|
CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 |
Base64-encoded SHA256 hash of the remote host's public key.
The transfer will fail if the given hash does not match the hash the remote host provides.
|
|
CURLOPT_SSH_PUBLIC_KEYFILE |
The file name for your public key. If not used, libcurl defaults to
$HOME/.ssh/id_dsa.pub if the HOME environment variable is set,
and just "id_dsa.pub" in the current directory if HOME is not set.
|
Added in cURL 7.16.1.
|
CURLOPT_SSH_PRIVATE_KEYFILE |
The file name for your private key. If not used, libcurl defaults to
$HOME/.ssh/id_dsa if the HOME environment variable is set,
and just "id_dsa" in the current directory if HOME is not set.
If the file is password-protected, set the password with
CURLOPT_KEYPASSWD .
|
Added in cURL 7.16.1.
|
CURLOPT_SSL_CIPHER_LIST |
一个SSL的加密算法列表。例如RC4-SHA 和TLSv1 都是可用的加密列表。
|
|
CURLOPT_SSL_EC_CURVES |
A colon delimited list of elliptic curve algorithms. For example,
X25519:P-521 is a valid list of two elliptic curves.
This option defines the client's key exchange algorithms in the SSL handshake,
if the SSL backend cURL is built to use supports it.
|
|
CURLOPT_SSLCERT |
一个包含 PEM 格式证书的文件名。
|
|
CURLOPT_SSLCERTPASSWD |
使用CURLOPT_SSLCERT 证书需要的密码。
|
|
CURLOPT_SSLCERTTYPE |
证书的类型。支持的格式有"PEM" (默认值), "DER" 和"ENG" 。
|
在 cURL 7.9.3中 被加入。
|
CURLOPT_SSLENGINE |
用来在CURLOPT_SSLKEY 中指定的SSL私钥的加密引擎变量。
|
|
CURLOPT_SSLENGINE_DEFAULT |
用来做非对称加密操作的变量。
|
|
CURLOPT_SSLKEY |
包含 SSL 私钥的文件名。
|
|
CURLOPT_SSLKEYPASSWD |
在 CURLOPT_SSLKEY 中指定了的SSL私钥的密码。
注意:
由于这个选项包含了敏感的密码信息,记得保证这个PHP脚本的安全。
|
|
CURLOPT_SSLKEYTYPE |
CURLOPT_SSLKEY 中规定的私钥的加密类型,支持的密钥类型为"PEM" (默认值)、"DER" 和"ENG" 。
|
|
CURLOPT_TLS13_CIPHERS |
用于 TLS 1.3 连接的加密套件列表。列表必须在语法上正确,它由一个或多个用冒号分隔的加密套件字符串组成。当前仅当 curl 编译为使用 OpenSSL 1.1.1
或更高版本时才使用此选项。如果使用不同的 SSL 后端,CURLOPT_SSL_CIPHER_LIST 选项设置 TLS 1.3 加密套件。
|
自 PHP 7.3.0 和 libcurl >= cURL 7.61.0 起可用。使用 OpenSSL >= 1.1.1 编译时可用。
|
CURLOPT_UNIX_SOCKET_PATH |
使用 Unix 套接字作为连接,并用指定的 string 作为路径。
|
cURL 7.40.0 中添加, PHP 7.0.7 起有效。
|
CURLOPT_URL |
需要获取的 URL 地址,也可以在curl_init() 初始化会话的时候。
|
|
CURLOPT_USERAGENT |
在HTTP请求中包含一个"User-Agent: " 头的字符串。
|
|
CURLOPT_USERNAME |
用于身份验证的用户名。
|
cURL 7.19.1 中添加。
|
CURLOPT_PASSWORD |
用于身份验证的密码。
|
cURL 7.19.1 中添加。
|
CURLOPT_USERPWD |
传递一个连接中需要的用户名和密码,格式为:"[username]:[password]" 。
|
|
CURLOPT_XOAUTH2_BEARER |
指定 OAuth 2.0 access token。
|
cURL 7.33.0 中添加,自 PHP 7.0.7 添加。
|