curl命令怎么用 curl常用命令及参数详解(13)
curl命令怎么用
curl dict://dict.org/show:db
curl dict://dict.org/show:strat
Authentication support is still missing
LDAP
If you have installed the OpenLDAP library, curl can take advantage of it and offer ldap:// support. On Windows, curl will use WinLDAP from Platform SDK by default.
Default protocol version used by curl is LDAPv3. LDAPv2 will be used as a fallback mechanism in case LDAPv3 fails to connect.
LDAP is a complex thing and writing an LDAP query is not an easy task. I do advise you to dig up the syntax description for that elsewhere. One such place might be: RFC 2255, The LDAP URL Format
To show you an example, this is how I can get all people from my local LDAP server that has a certain sub-domain in their email address:
curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se"
If I want the same info in HTML format, I can get it by not using the -B (enforce ASCII) flag.
You also can use authentication when accessing LDAP catalog:
curl -u user:passwd "ldap://ldap.frontec.se/o=frontec??sub?mail=*"
curl "ldap://user:passwd@ldap.frontec.se/o=frontec??sub?mail=*"
By default, if user and password are provided, OpenLDAP/WinLDAP will use basic authentication. On Windows you can control this behavior by providing one of --basic, --ntlm or --digest option in curl command line
curl --ntlm "ldap://user:passwd@ldap.frontec.se/o=frontec??sub?mail=*"
On Windows, if no user/password specified, auto-negotiation mechanism will be used with current logon credentials (SSPI/SPNEGO).
Environment Variables
Curl reads and understands the following environment variables:
http_proxy, HTTPS_PROXY, FTP_PROXY
They should be set for protocol-specific proxies. General proxy should be set with
ALL_PROXY
设置了不应通过任何代理的主机名的逗号分隔列表(只有星号,*匹配所有主机)
NO_PROXY
如果主机名与这些字符串之一匹配,或者主机位于这些字符串之一的域内,则不会代理与该节点的事务。使用域时,需要以句点开头。用户可以通过设置为来指定www.example.com和 foo.example.com 都不应使用代理。通过包含全名,您可以排除特定的主机名,因此要不使用代理但仍然可以使用,请设置为.NO_PROXY.example.comwww.example.comfoo.example.comNO_PROXYwww.example.com
-x/标志的使用--proxy会覆盖环境变量。
网路
Unix.netrc很久以前就引入了这个概念。这是用户在文件中为经常访问的 FTP 站点指定名称和密码的一种方式,这样您就不必在每次访问这些站点时都输入它们。您意识到如果其他人掌握了您的密码,这是一个很大的安全风险,因此大多数 Unix 程序不会读取此文件,除非它只能由您自己读取(但 curl 不在乎)。
.netrc如果被告知,Curl 支持文件(使用-n/--netrc和--netrc-optional选项)。这不仅限于 FTP,因此 curl 可以将它用于所有使用身份验证的协议。
相关阅读
-
网站推广的基本方法为哪些 网络营销与策划方案
小编为网友们解答网站推广的基本方法为哪些和网络营销与策划方案方面的内容,具体详情如下: 网络世界已变成当代人不可或缺的一种生活习惯,因此,以互联网为基本的商业主题活动也日
-
定制网站建设哪家便宜好做 网页设计制作网站推荐
今天分享:定制网站建设哪家便宜好做和网页设计制作网站推荐方面的内容,接下来就是全面介绍。 网站建设如果能够做得比较好的话,一般能够给其他人留下一个比较深刻的印象,这对于任
-
网站设计制作从哪里学起 html零基础入门教程
你是不是想知道网站设计制作从哪里学起和html零基础入门教程的介绍,请看下面详细的介绍。 网站是很多人都会使用的工具,但是做网站对于大部分人来说就不是件容易的事了,在这里,把学
-
JS怎么判断奇偶数方法代码 javascript判断奇偶数代码及原理详解
javascript判断奇偶数代码 ,以及判断奇偶数的原理分享给各位JS初学者。 代码如下: !DOCTYPE htmlhtmlheadmeta charset="utf-8"meta name="viewport" content="width=device-width, initial-scale=1"title判断奇偶数/title/headb


