API测试工具_微博开放平台:https://open.weibo.com/tools/console#

感兴趣是可以使用这个工具玩一下restful接口调用,可以更形象的了解restful

下面我们就继续下面的内内容讲解curl命令

什么是CURL?
就是以命令的方式来执行HTTP协议的请求的工具
可以通过CURL操作HTTP的GET/POST/PUT/DELETE方法

下面我们就详细说下CURL这个命令的使用,这个curl命令在linux下是自带的,登陆一个linux的操作系统

我们看一下curl  --help查看帮助这个curl命令有那些参数,看到有很多

[root@backup01 java]# curl --help
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP only--anyauth       Pick "any" authentication method (H)-a, --append        Append to target file when uploading (F/SFTP)--basic         Use HTTP Basic Authentication (H)--cacert FILE   CA certificate to verify peer against (SSL)--capath DIR    CA directory to verify peer against (SSL)-E, --cert CERT[:PASSWD] Client certificate file and password (SSL)--cert-type TYPE Certificate file type (DER/PEM/ENG) (SSL)--ciphers LIST  SSL ciphers to use (SSL)--compressed    Request compressed response (using deflate or gzip)-K, --config FILE   Specify which config file to read--connect-timeout SECONDS  Maximum time allowed for connection-C, --continue-at OFFSET  Resumed transfer offset-b, --cookie STRING/FILE  String or file to read cookies from (H)-c, --cookie-jar FILE  Write cookies to this file after operation (H)--create-dirs   Create necessary local directory hierarchy--crlf          Convert LF to CRLF in upload--crlfile FILE  Get a CRL list in PEM format from the given file-d, --data DATA     HTTP POST data (H)--data-ascii DATA  HTTP POST ASCII data (H)--data-binary DATA  HTTP POST binary data (H)--data-urlencode DATA  HTTP POST data url encoded (H)--delegation STRING GSS-API delegation permission--digest        Use HTTP Digest Authentication (H)--disable-eprt  Inhibit using EPRT or LPRT (F)--disable-epsv  Inhibit using EPSV (F)-D, --dump-header FILE  Write the headers to this file--egd-file FILE  EGD socket path for random data (SSL)--engine ENGINGE  Crypto engine (SSL). "--engine list" for list-f, --fail          Fail silently (no output at all) on HTTP errors (H)-F, --form CONTENT  Specify HTTP multipart POST data (H)--form-string STRING  Specify HTTP multipart POST data (H)--ftp-account DATA  Account data string (F)--ftp-alternative-to-user COMMAND  String to replace "USER [name]" (F)--ftp-create-dirs  Create the remote dirs if not present (F)--ftp-method [MULTICWD/NOCWD/SINGLECWD] Control CWD usage (F)--ftp-pasv      Use PASV/EPSV instead of PORT (F)-P, --ftp-port ADR  Use PORT with given address instead of PASV (F)--ftp-skip-pasv-ip Skip the IP address for PASV (F)--ftp-pret      Send PRET before PASV (for drftpd) (F)--ftp-ssl-ccc   Send CCC after authenticating (F)--ftp-ssl-ccc-mode ACTIVE/PASSIVE  Set CCC mode (F)--ftp-ssl-control Require SSL/TLS for ftp login, clear for transfer (F)-G, --get           Send the -d data with a HTTP GET (H)-g, --globoff       Disable URL sequences and ranges using {} and []-H, --header LINE   Custom header to pass to server (H)-I, --head          Show document info only-h, --help          This help text--hostpubmd5 MD5  Hex encoded MD5 string of the host public key. (SSH)-0, --http1.0       Use HTTP 1.0 (H)--ignore-content-length  Ignore the HTTP Content-Length header-i, --include       Include protocol headers in the output (H/F)-k, --insecure      Allow connections to SSL sites without certs (H)--interface INTERFACE  Specify network interface/address to use-4, --ipv4          Resolve name to IPv4 address-6, --ipv6          Resolve name to IPv6 address-j, --junk-session-cookies Ignore session cookies read from file (H)--keepalive-time SECONDS  Interval between keepalive probes--key KEY       Private key file name (SSL/SSH)--key-type TYPE Private key file type (DER/PEM/ENG) (SSL)--krb LEVEL     Enable Kerberos with specified security level (F)--libcurl FILE  Dump libcurl equivalent code of this command line--limit-rate RATE  Limit transfer speed to this rate-l, --list-only     List only names of an FTP directory (F)--local-port RANGE  Force use of these local port numbers-L, --location      Follow redirects (H)--location-trusted like --location and send auth to other hosts (H)-M, --manual        Display the full manual--mail-from FROM  Mail from this address--mail-rcpt TO  Mail to this receiver(s)--mail-auth AUTH  Originator address of the original email--max-filesize BYTES  Maximum file size to download (H/F)--max-redirs NUM  Maximum number of redirects allowed (H)-m, --max-time SECONDS  Maximum time allowed for the transfer--metalink      Process given URLs as metalink XML file--negotiate     Use HTTP Negotiate Authentication (H)-n, --netrc         Must read .netrc for user name and password--netrc-optional Use either .netrc or URL; overrides -n--netrc-file FILE  Set up the netrc filename to use-N, --no-buffer     Disable buffering of the output stream--no-keepalive  Disable keepalive use on the connection--no-sessionid  Disable SSL session-ID reusing (SSL)--noproxy       List of hosts which do not use proxy--ntlm          Use HTTP NTLM authentication (H)-o, --output FILE   Write output to <file> instead of stdout--pass PASS     Pass phrase for the private key (SSL/SSH)--post301       Do not switch to GET after following a 301 redirect (H)--post302       Do not switch to GET after following a 302 redirect (H)--post303       Do not switch to GET after following a 303 redirect (H)-#, --progress-bar  Display transfer progress as a progress bar--proto PROTOCOLS  Enable/disable specified protocols--proto-redir PROTOCOLS  Enable/disable specified protocols on redirect-x, --proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port--proxy-anyauth Pick "any" proxy authentication method (H)--proxy-basic   Use Basic authentication on the proxy (H)--proxy-digest  Use Digest authentication on the proxy (H)--proxy-negotiate Use Negotiate authentication on the proxy (H)--proxy-ntlm    Use NTLM authentication on the proxy (H)-U, --proxy-user USER[:PASSWORD]  Proxy user and password--proxy1.0 HOST[:PORT]  Use HTTP/1.0 proxy on given port-p, --proxytunnel   Operate through a HTTP proxy tunnel (using CONNECT)--pubkey KEY    Public key file name (SSH)-Q, --quote CMD     Send command(s) to server before transfer (F/SFTP)--random-file FILE  File for reading random data from (SSL)-r, --range RANGE   Retrieve only the bytes within a range--raw           Do HTTP "raw", without any transfer decoding (H)-e, --referer       Referer URL (H)-J, --remote-header-name Use the header-provided filename (H)-O, --remote-name   Write output to a file named as the remote file--remote-name-all Use the remote file name for all URLs-R, --remote-time   Set the remote file's time on the local output-X, --request COMMAND  Specify request command to use--resolve HOST:PORT:ADDRESS  Force resolve of HOST:PORT to ADDRESS--retry NUM   Retry request NUM times if transient problems occur--retry-delay SECONDS When retrying, wait this many seconds between each--retry-max-time SECONDS  Retry only within this period-S, --show-error    Show error. With -s, make curl show errors when they occur-s, --silent        Silent mode. Don't output anything--socks4 HOST[:PORT]  SOCKS4 proxy on given host + port--socks4a HOST[:PORT]  SOCKS4a proxy on given host + port--socks5 HOST[:PORT]  SOCKS5 proxy on given host + port--socks5-basic  Enable username/password auth for SOCKS5 proxies--socks5-gssapi Enable GSS-API auth for SOCKS5 proxies--socks5-hostname HOST[:PORT] SOCKS5 proxy, pass host name to proxy--socks5-gssapi-service NAME  SOCKS5 proxy service name for gssapi--socks5-gssapi-nec  Compatibility with NEC SOCKS5 server-Y, --speed-limit RATE  Stop transfers below speed-limit for 'speed-time' secs-y, --speed-time SECONDS  Time for trig speed-limit abort. Defaults to 30--ssl           Try SSL/TLS (FTP, IMAP, POP3, SMTP)--ssl-reqd      Require SSL/TLS (FTP, IMAP, POP3, SMTP)-2, --sslv2         Use SSLv2 (SSL)-3, --sslv3         Use SSLv3 (SSL)--ssl-allow-beast Allow security flaw to improve interop (SSL)--stderr FILE   Where to redirect stderr. - means stdout--tcp-nodelay   Use the TCP_NODELAY option-t, --telnet-option OPT=VAL  Set telnet option--tftp-blksize VALUE  Set TFTP BLKSIZE option (must be >512)-z, --time-cond TIME  Transfer based on a time condition-1, --tlsv1         Use => TLSv1 (SSL)--tlsv1.0       Use TLSv1.0 (SSL)--tlsv1.1       Use TLSv1.1 (SSL)--tlsv1.2       Use TLSv1.2 (SSL)--trace FILE    Write a debug trace to the given file--trace-ascii FILE  Like --trace but without the hex output--trace-time    Add time stamps to trace/verbose output--tr-encoding   Request compressed transfer encoding (H)-T, --upload-file FILE  Transfer FILE to destination--url URL       URL to work with-B, --use-ascii     Use ASCII/text transfer-u, --user USER[:PASSWORD]  Server user and password--tlsuser USER  TLS username--tlspassword STRING TLS password--tlsauthtype STRING  TLS authentication type (default SRP)--unix-socket FILE    Connect through this UNIX domain socket-A, --user-agent STRING  User-Agent to send to server (H)-v, --verbose       Make the operation more talkative-V, --version       Show version number and quit-w, --write-out FORMAT  What to output after completion--xattr        Store metadata in extended file attributes-q                 If used as the first parameter disables .curlrc
[root@backup01 java]#

看到这么多参数,有点晕乎,其实不用背,当你用到的时候去查一下

下面我们使用这个curl名师实际操作一下,比如我能直接访问百度

报了一个未知错误百度了一下这个问题,都说是DNS的问题,因此修改一下DNS配置,

vim /etc/resolv.conf

修改之后的

然后重新     curl www.baidu.com

html的页面已经成功返回

结果只是加上了nameserver 114.114.114.114就可以了,网上了解到的可能是电信DNS有调整的缘故,但是具体的原因还是不得而知。

如果我们要保存这个网页我们只需要命令加一个  -o   就可以了

curl -o baidu.html www.baidu.com

我们打开这个baidu.html看下

curl -i www.baidu.com  显示http response请求头信息

curl -v www.baidu.com

curl --trace output.txt www.baidu.com  (把信息输入到文本中)

cat output.txt   (查看txt文件)

[root@backup01 local]# cat output.txt
== Info: About to connect() to www.baidu.com port 80 (#0)
== Info:   Trying 14.215.177.39...
== Info: Connected to www.baidu.com (14.215.177.39) port 80 (#0)
=> Send header, 77 bytes (0x4d)
0000: 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1..
0010: 55 73 65 72 2d 41 67 65 6e 74 3a 20 63 75 72 6c User-Agent: curl
0020: 2f 37 2e 32 39 2e 30 0d 0a 48 6f 73 74 3a 20 77 /7.29.0..Host: w
0030: 77 77 2e 62 61 69 64 75 2e 63 6f 6d 0d 0a 41 63 ww.baidu.com..Ac
0040: 63 65 70 74 3a 20 2a 2f 2a 0d 0a 0d 0a          cept: */*....
<= Recv header, 17 bytes (0x11)
0000: 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d HTTP/1.1 200 OK.
0010: 0a                                              .
<= Recv header, 22 bytes (0x16)
0000: 41 63 63 65 70 74 2d 52 61 6e 67 65 73 3a 20 62 Accept-Ranges: b
0010: 79 74 65 73 0d 0a                               ytes..
<= Recv header, 76 bytes (0x4c)
0000: 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 70 Cache-Control: p
0010: 72 69 76 61 74 65 2c 20 6e 6f 2d 63 61 63 68 65 rivate, no-cache
0020: 2c 20 6e 6f 2d 73 74 6f 72 65 2c 20 70 72 6f 78 , no-store, prox
0030: 79 2d 72 65 76 61 6c 69 64 61 74 65 2c 20 6e 6f y-revalidate, no
0040: 2d 74 72 61 6e 73 66 6f 72 6d 0d 0a             -transform..
<= Recv header, 24 bytes (0x18)
0000: 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 Connection: keep
0010: 2d 61 6c 69 76 65 0d 0a                         -alive..
<= Recv header, 22 bytes (0x16)
0000: 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 Content-Length:
0010: 32 33 38 31 0d 0a                               2381..
<= Recv header, 25 bytes (0x19)
0000: 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 Content-Type: te
0010: 78 74 2f 68 74 6d 6c 0d 0a                      xt/html..
<= Recv header, 37 bytes (0x25)
0000: 44 61 74 65 3a 20 53 61 74 2c 20 30 37 20 4d 61 Date: Sat, 07 Ma
0010: 72 20 32 30 32 30 20 30 37 3a 31 31 3a 32 37 20 r 2020 07:11:27
0020: 47 4d 54 0d 0a                                  GMT..
<= Recv header, 22 bytes (0x16)
0000: 45 74 61 67 3a 20 22 35 38 38 36 30 34 64 63 2d Etag: "588604dc-
0010: 39 34 64 22 0d 0a                               94d"..
<= Recv header, 46 bytes (0x2e)
0000: 4c 61 73 74 2d 4d 6f 64 69 66 69 65 64 3a 20 4d Last-Modified: M
0010: 6f 6e 2c 20 32 33 20 4a 61 6e 20 32 30 31 37 20 on, 23 Jan 2017
0020: 31 33 3a 32 37 3a 35 36 20 47 4d 54 0d 0a       13:27:56 GMT..
<= Recv header, 18 bytes (0x12)
0000: 50 72 61 67 6d 61 3a 20 6e 6f 2d 63 61 63 68 65 Pragma: no-cache
0010: 0d 0a                                           ..
<= Recv header, 22 bytes (0x16)
0000: 53 65 72 76 65 72 3a 20 62 66 65 2f 31 2e 30 2e Server: bfe/1.0.
0010: 38 2e 31 38 0d 0a                               8.18..
<= Recv header, 67 bytes (0x43)
0000: 53 65 74 2d 43 6f 6f 6b 69 65 3a 20 42 44 4f 52 Set-Cookie: BDOR
0010: 5a 3d 32 37 33 31 35 3b 20 6d 61 78 2d 61 67 65 Z=27315; max-age
0020: 3d 38 36 34 30 30 3b 20 64 6f 6d 61 69 6e 3d 2e =86400; domain=.
0030: 62 61 69 64 75 2e 63 6f 6d 3b 20 70 61 74 68 3d baidu.com; path=
0040: 2f 0d 0a                                        /..
<= Recv header, 2 bytes (0x2)
0000: 0d 0a                                           ..
<= Recv data, 1040 bytes (0x410)
0000: 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e 0d <!DOCTYPE html>.
0010: 0a 3c 21 2d 2d 53 54 41 54 55 53 20 4f 4b 2d 2d .<!--STATUS OK--
0020: 3e 3c 68 74 6d 6c 3e 20 3c 68 65 61 64 3e 3c 6d ><html> <head><m
0030: 65 74 61 20 68 74 74 70 2d 65 71 75 69 76 3d 63 eta http-equiv=c
0040: 6f 6e 74 65 6e 74 2d 74 79 70 65 20 63 6f 6e 74 ontent-type cont
0050: 65 6e 74 3d 74 65 78 74 2f 68 74 6d 6c 3b 63 68 ent=text/html;ch
0060: 61 72 73 65 74 3d 75 74 66 2d 38 3e 3c 6d 65 74 arset=utf-8><met
0070: 61 20 68 74 74 70 2d 65 71 75 69 76 3d 58 2d 55 a http-equiv=X-U
0080: 41 2d 43 6f 6d 70 61 74 69 62 6c 65 20 63 6f 6e A-Compatible con
0090: 74 65 6e 74 3d 49 45 3d 45 64 67 65 3e 3c 6d 65 tent=IE=Edge><me
00a0: 74 61 20 63 6f 6e 74 65 6e 74 3d 61 6c 77 61 79 ta content=alway
00b0: 73 20 6e 61 6d 65 3d 72 65 66 65 72 72 65 72 3e s name=referrer>
00c0: 3c 6c 69 6e 6b 20 72 65 6c 3d 73 74 79 6c 65 73 <link rel=styles
00d0: 68 65 65 74 20 74 79 70 65 3d 74 65 78 74 2f 63 heet type=text/c
00e0: 73 73 20 68 72 65 66 3d 68 74 74 70 3a 2f 2f 73 ss href=http://s
00f0: 31 2e 62 64 73 74 61 74 69 63 2e 63 6f 6d 2f 72 1.bdstatic.com/r
0100: 2f 77 77 77 2f 63 61 63 68 65 2f 62 64 6f 72 7a /www/cache/bdorz
0110: 2f 62 61 69 64 75 2e 6d 69 6e 2e 63 73 73 3e 3c /baidu.min.css><
0120: 74 69 74 6c 65 3e e7 99 be e5 ba a6 e4 b8 80 e4 title>..........
0130: b8 8b ef bc 8c e4 bd a0 e5 b0 b1 e7 9f a5 e9 81 ................
0140: 93 3c 2f 74 69 74 6c 65 3e 3c 2f 68 65 61 64 3e .</title></head>
0150: 20 3c 62 6f 64 79 20 6c 69 6e 6b 3d 23 30 30 30  <body link=#000
0160: 30 63 63 3e 20 3c 64 69 76 20 69 64 3d 77 72 61 0cc> <div id=wra
0170: 70 70 65 72 3e 20 3c 64 69 76 20 69 64 3d 68 65 pper> <div id=he
0180: 61 64 3e 20 3c 64 69 76 20 63 6c 61 73 73 3d 68 ad> <div class=h
0190: 65 61 64 5f 77 72 61 70 70 65 72 3e 20 3c 64 69 ead_wrapper> <di
01a0: 76 20 63 6c 61 73 73 3d 73 5f 66 6f 72 6d 3e 20 v class=s_form>
01b0: 3c 64 69 76 20 63 6c 61 73 73 3d 73 5f 66 6f 72 <div class=s_for
01c0: 6d 5f 77 72 61 70 70 65 72 3e 20 3c 64 69 76 20 m_wrapper> <div
01d0: 69 64 3d 6c 67 3e 20 3c 69 6d 67 20 68 69 64 65 id=lg> <img hide
01e0: 66 6f 63 75 73 3d 74 72 75 65 20 73 72 63 3d 2f focus=true src=/
01f0: 2f 77 77 77 2e 62 61 69 64 75 2e 63 6f 6d 2f 69 /www.baidu.com/i
0200: 6d 67 2f 62 64 5f 6c 6f 67 6f 31 2e 70 6e 67 20 mg/bd_logo1.png
0210: 77 69 64 74 68 3d 32 37 30 20 68 65 69 67 68 74 width=270 height
0220: 3d 31 32 39 3e 20 3c 2f 64 69 76 3e 20 3c 66 6f =129> </div> <fo
0230: 72 6d 20 69 64 3d 66 6f 72 6d 20 6e 61 6d 65 3d rm id=form name=
0240: 66 20 61 63 74 69 6f 6e 3d 2f 2f 77 77 77 2e 62 f action=//www.b
0250: 61 69 64 75 2e 63 6f 6d 2f 73 20 63 6c 61 73 73 aidu.com/s class
0260: 3d 66 6d 3e 20 3c 69 6e 70 75 74 20 74 79 70 65 =fm> <input type
0270: 3d 68 69 64 64 65 6e 20 6e 61 6d 65 3d 62 64 6f =hidden name=bdo
0280: 72 7a 5f 63 6f 6d 65 20 76 61 6c 75 65 3d 31 3e rz_come value=1>
0290: 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 68 69 64  <input type=hid
02a0: 64 65 6e 20 6e 61 6d 65 3d 69 65 20 76 61 6c 75 den name=ie valu
02b0: 65 3d 75 74 66 2d 38 3e 20 3c 69 6e 70 75 74 20 e=utf-8> <input
02c0: 74 79 70 65 3d 68 69 64 64 65 6e 20 6e 61 6d 65 type=hidden name
02d0: 3d 66 20 76 61 6c 75 65 3d 38 3e 20 3c 69 6e 70 =f value=8> <inp
02e0: 75 74 20 74 79 70 65 3d 68 69 64 64 65 6e 20 6e ut type=hidden n
02f0: 61 6d 65 3d 72 73 76 5f 62 70 20 76 61 6c 75 65 ame=rsv_bp value
0300: 3d 31 3e 20 3c 69 6e 70 75 74 20 74 79 70 65 3d =1> <input type=
0310: 68 69 64 64 65 6e 20 6e 61 6d 65 3d 72 73 76 5f hidden name=rsv_
0320: 69 64 78 20 76 61 6c 75 65 3d 31 3e 20 3c 69 6e idx value=1> <in
0330: 70 75 74 20 74 79 70 65 3d 68 69 64 64 65 6e 20 put type=hidden
0340: 6e 61 6d 65 3d 74 6e 20 76 61 6c 75 65 3d 62 61 name=tn value=ba
0350: 69 64 75 3e 3c 73 70 61 6e 20 63 6c 61 73 73 3d idu><span class=
0360: 22 62 67 20 73 5f 69 70 74 5f 77 72 22 3e 3c 69 "bg s_ipt_wr"><i
0370: 6e 70 75 74 20 69 64 3d 6b 77 20 6e 61 6d 65 3d nput id=kw name=
0380: 77 64 20 63 6c 61 73 73 3d 73 5f 69 70 74 20 76 wd class=s_ipt v
0390: 61 6c 75 65 20 6d 61 78 6c 65 6e 67 74 68 3d 32 alue maxlength=2
03a0: 35 35 20 61 75 74 6f 63 6f 6d 70 6c 65 74 65 3d 55 autocomplete=
03b0: 6f 66 66 20 61 75 74 6f 66 6f 63 75 73 3e 3c 2f off autofocus></
03c0: 73 70 61 6e 3e 3c 73 70 61 6e 20 63 6c 61 73 73 span><span class
03d0: 3d 22 62 67 20 73 5f 62 74 6e 5f 77 72 22 3e 3c ="bg s_btn_wr"><
03e0: 69 6e 70 75 74 20 74 79 70 65 3d 73 75 62 6d 69 input type=submi
03f0: 74 20 69 64 3d 73 75 20 76 61 6c 75 65 3d e7 99 t id=su value=..
0400: be e5 ba a6 e4 b8 80 e4 b8 8b 20 63 6c 61 73 73 .......... class
<= Recv data, 1341 bytes (0x53d)
0000: 3d 22 62 67 20 73 5f 62 74 6e 22 3e 3c 2f 73 70 ="bg s_btn"></sp
0010: 61 6e 3e 20 3c 2f 66 6f 72 6d 3e 20 3c 2f 64 69 an> </form> </di
0020: 76 3e 20 3c 2f 64 69 76 3e 20 3c 64 69 76 20 69 v> </div> <div i
0030: 64 3d 75 31 3e 20 3c 61 20 68 72 65 66 3d 68 74 d=u1> <a href=ht
0040: 74 70 3a 2f 2f 6e 65 77 73 2e 62 61 69 64 75 2e tp://news.baidu.
0050: 63 6f 6d 20 6e 61 6d 65 3d 74 6a 5f 74 72 6e 65 com name=tj_trne
0060: 77 73 20 63 6c 61 73 73 3d 6d 6e 61 76 3e e6 96 ws class=mnav>..
0070: b0 e9 97 bb 3c 2f 61 3e 20 3c 61 20 68 72 65 66 ....</a> <a href
0080: 3d 68 74 74 70 3a 2f 2f 77 77 77 2e 68 61 6f 31 =http://www.hao1
0090: 32 33 2e 63 6f 6d 20 6e 61 6d 65 3d 74 6a 5f 74 23.com name=tj_t
00a0: 72 68 61 6f 31 32 33 20 63 6c 61 73 73 3d 6d 6e rhao123 class=mn
00b0: 61 76 3e 68 61 6f 31 32 33 3c 2f 61 3e 20 3c 61 av>hao123</a> <a
00c0: 20 68 72 65 66 3d 68 74 74 70 3a 2f 2f 6d 61 70  href=http://map
00d0: 2e 62 61 69 64 75 2e 63 6f 6d 20 6e 61 6d 65 3d .baidu.com name=
00e0: 74 6a 5f 74 72 6d 61 70 20 63 6c 61 73 73 3d 6d tj_trmap class=m
00f0: 6e 61 76 3e e5 9c b0 e5 9b be 3c 2f 61 3e 20 3c nav>......</a> <
0100: 61 20 68 72 65 66 3d 68 74 74 70 3a 2f 2f 76 2e a href=http://v.
0110: 62 61 69 64 75 2e 63 6f 6d 20 6e 61 6d 65 3d 74 baidu.com name=t
0120: 6a 5f 74 72 76 69 64 65 6f 20 63 6c 61 73 73 3d j_trvideo class=
0130: 6d 6e 61 76 3e e8 a7 86 e9 a2 91 3c 2f 61 3e 20 mnav>......</a>
0140: 3c 61 20 68 72 65 66 3d 68 74 74 70 3a 2f 2f 74 <a href=http://t
0150: 69 65 62 61 2e 62 61 69 64 75 2e 63 6f 6d 20 6e ieba.baidu.com n
0160: 61 6d 65 3d 74 6a 5f 74 72 74 69 65 62 61 20 63 ame=tj_trtieba c
0170: 6c 61 73 73 3d 6d 6e 61 76 3e e8 b4 b4 e5 90 a7 lass=mnav>......
0180: 3c 2f 61 3e 20 3c 6e 6f 73 63 72 69 70 74 3e 20 </a> <noscript>
0190: 3c 61 20 68 72 65 66 3d 68 74 74 70 3a 2f 2f 77 <a href=http://w
01a0: 77 77 2e 62 61 69 64 75 2e 63 6f 6d 2f 62 64 6f ww.baidu.com/bdo
01b0: 72 7a 2f 6c 6f 67 69 6e 2e 67 69 66 3f 6c 6f 67 rz/login.gif?log
01c0: 69 6e 26 61 6d 70 3b 74 70 6c 3d 6d 6e 26 61 6d in&amp;tpl=mn&am
01d0: 70 3b 75 3d 68 74 74 70 25 33 41 25 32 46 25 32 p;u=http%3A%2F%2
01e0: 46 77 77 77 2e 62 61 69 64 75 2e 63 6f 6d 25 32 Fwww.baidu.com%2
01f0: 66 25 33 66 62 64 6f 72 7a 5f 63 6f 6d 65 25 33 f%3fbdorz_come%3
0200: 64 31 20 6e 61 6d 65 3d 74 6a 5f 6c 6f 67 69 6e d1 name=tj_login
0210: 20 63 6c 61 73 73 3d 6c 62 3e e7 99 bb e5 bd 95  class=lb>......
0220: 3c 2f 61 3e 20 3c 2f 6e 6f 73 63 72 69 70 74 3e </a> </noscript>
0230: 20 3c 73 63 72 69 70 74 3e 64 6f 63 75 6d 65 6e  <script>documen
0240: 74 2e 77 72 69 74 65 28 27 3c 61 20 68 72 65 66 t.write('<a href
0250: 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 62 61 69 ="http://www.bai
0260: 64 75 2e 63 6f 6d 2f 62 64 6f 72 7a 2f 6c 6f 67 du.com/bdorz/log
0270: 69 6e 2e 67 69 66 3f 6c 6f 67 69 6e 26 74 70 6c in.gif?login&tpl
0280: 3d 6d 6e 26 75 3d 27 2b 20 65 6e 63 6f 64 65 55 =mn&u='+ encodeU
0290: 52 49 43 6f 6d 70 6f 6e 65 6e 74 28 77 69 6e 64 RIComponent(wind
02a0: 6f 77 2e 6c 6f 63 61 74 69 6f 6e 2e 68 72 65 66 ow.location.href
02b0: 2b 20 28 77 69 6e 64 6f 77 2e 6c 6f 63 61 74 69 + (window.locati
02c0: 6f 6e 2e 73 65 61 72 63 68 20 3d 3d 3d 20 22 22 on.search === ""
02d0: 20 3f 20 22 3f 22 20 3a 20 22 26 22 29 2b 20 22  ? "?" : "&")+ "
02e0: 62 64 6f 72 7a 5f 63 6f 6d 65 3d 31 22 29 2b 20 bdorz_come=1")+
02f0: 27 22 20 6e 61 6d 65 3d 22 74 6a 5f 6c 6f 67 69 '" name="tj_logi
0300: 6e 22 20 63 6c 61 73 73 3d 22 6c 62 22 3e e7 99 n" class="lb">..
0310: bb e5 bd 95 3c 2f 61 3e 27 29 3b 3c 2f 73 63 72 ....</a>');</scr
0320: 69 70 74 3e 20 3c 61 20 68 72 65 66 3d 2f 2f 77 ipt> <a href=//w
0330: 77 77 2e 62 61 69 64 75 2e 63 6f 6d 2f 6d 6f 72 ww.baidu.com/mor
0340: 65 2f 20 6e 61 6d 65 3d 74 6a 5f 62 72 69 69 63 e/ name=tj_briic
0350: 6f 6e 20 63 6c 61 73 73 3d 62 72 69 20 73 74 79 on class=bri sty
0360: 6c 65 3d 22 64 69 73 70 6c 61 79 3a 20 62 6c 6f le="display: blo
0370: 63 6b 3b 22 3e e6 9b b4 e5 a4 9a e4 ba a7 e5 93 ck;">...........
0380: 81 3c 2f 61 3e 20 3c 2f 64 69 76 3e 20 3c 2f 64 .</a> </div> </d
0390: 69 76 3e 20 3c 2f 64 69 76 3e 20 3c 64 69 76 20 iv> </div> <div
03a0: 69 64 3d 66 74 43 6f 6e 3e 20 3c 64 69 76 20 69 id=ftCon> <div i
03b0: 64 3d 66 74 43 6f 6e 77 3e 20 3c 70 20 69 64 3d d=ftConw> <p id=
03c0: 6c 68 3e 20 3c 61 20 68 72 65 66 3d 68 74 74 70 lh> <a href=http
03d0: 3a 2f 2f 68 6f 6d 65 2e 62 61 69 64 75 2e 63 6f ://home.baidu.co
03e0: 6d 3e e5 85 b3 e4 ba 8e e7 99 be e5 ba a6 3c 2f m>............</
03f0: 61 3e 20 3c 61 20 68 72 65 66 3d 68 74 74 70 3a a> <a href=http:
0400: 2f 2f 69 72 2e 62 61 69 64 75 2e 63 6f 6d 3e 41 //ir.baidu.com>A
0410: 62 6f 75 74 20 42 61 69 64 75 3c 2f 61 3e 20 3c bout Baidu</a> <
0420: 2f 70 3e 20 3c 70 20 69 64 3d 63 70 3e 26 63 6f /p> <p id=cp>&co
0430: 70 79 3b 32 30 31 37 26 6e 62 73 70 3b 42 61 69 py;2017&nbsp;Bai
0440: 64 75 26 6e 62 73 70 3b 3c 61 20 68 72 65 66 3d du&nbsp;<a href=
0450: 68 74 74 70 3a 2f 2f 77 77 77 2e 62 61 69 64 75 http://www.baidu
0460: 2e 63 6f 6d 2f 64 75 74 79 2f 3e e4 bd bf e7 94 .com/duty/>.....
0470: a8 e7 99 be e5 ba a6 e5 89 8d e5 bf 85 e8 af bb ................
0480: 3c 2f 61 3e 26 6e 62 73 70 3b 20 3c 61 20 68 72 </a>&nbsp; <a hr
0490: 65 66 3d 68 74 74 70 3a 2f 2f 6a 69 61 6e 79 69 ef=http://jianyi
04a0: 2e 62 61 69 64 75 2e 63 6f 6d 2f 20 63 6c 61 73 .baidu.com/ clas
04b0: 73 3d 63 70 2d 66 65 65 64 62 61 63 6b 3e e6 84 s=cp-feedback>..
04c0: 8f e8 a7 81 e5 8f 8d e9 a6 88 3c 2f 61 3e 26 6e ..........</a>&n
04d0: 62 73 70 3b e4 ba ac 49 43 50 e8 af 81 30 33 30 bsp;...ICP...030
04e0: 31 37 33 e5 8f b7 26 6e 62 73 70 3b 20 3c 69 6d 173...&nbsp; <im
04f0: 67 20 73 72 63 3d 2f 2f 77 77 77 2e 62 61 69 64 g src=//www.baid
0500: 75 2e 63 6f 6d 2f 69 6d 67 2f 67 73 2e 67 69 66 u.com/img/gs.gif
0510: 3e 20 3c 2f 70 3e 20 3c 2f 64 69 76 3e 20 3c 2f > </p> </div> </
0520: 64 69 76 3e 20 3c 2f 64 69 76 3e 20 3c 2f 62 6f div> </div> </bo
0530: 64 79 3e 20 3c 2f 68 74 6d 6c 3e 0d 0a          dy> </html>..
== Info: Connection #0 to host www.baidu.com left intact
[root@backup01 local]#

curl www.baidu.com 和  curl -X GET www.baidu.com是一样的默认就是GET

ElasticSearch快速入门三(curl命令讲解)相关推荐

  1. sql语言和php,SQL语言快速入门(三)_php

    我们日常使用SQL语言的工作过程中,使用最多的还是从已经建立好的数据库中查询信息.下面,我们就来详细介绍一下如何使用SQL语言实现各种数据库查询操作. SELECT-FROM 为方便讲解,我们在数据库 ...

  2. ElasticSearch快速入门二(Restful介绍)

    本节课从三个方便讲解 什么是restful ? API: Application Programming Interface的缩写,中文意思就是应用程序接口. ●XML: . 可扩展标记语言,是一种程 ...

  3. ELK之ElasticSearch快速入门

    ElasticSearch快速入门 一.简介 二.下载 三.启动 4.基本概念 5. 一.简介 官网:https://www.elastic.co/ ElasticSearch是Elastic Sta ...

  4. Elasticsearch快速入门2 - 高级查询功能

    我们在Elasticsearch快速入门1中详细介绍了ES的安装.基本概念和一些基本的REST Api请求,在这篇入门(2)中,我们继续介绍ES的高级查询功能. 为了说明ES强大的搜索功能,我们还以上 ...

  5. 尚硅谷-SpringBoot高级-检索-Elasticsearch快速入门

    前面我们安装好了ElasticSearch,我以后就简称他为ES,而一些人还不知道基本的使用,那我们接下来做一个快速入门,了解一下他的使用方法,以及一些基本概念,方便我们后来整合,那么要学习ES最好的 ...

  6. ElasticSearch快速入门详解(亲测好用,强烈推荐收藏)

    3.快速入门 接下来快速看下elasticsearch的使用 3.1.概念 Elasticsearch虽然是一种NoSql库,但最终的目的是存储数据.检索数据.因此很多概念与MySQL类似的. ES中 ...

  7. Go Elasticsearch 快速入门

    文章目录 1.入门简介 2.基本概念 3.客户端库 4.创建客户端 5.index 增删改查 6.增加 7.删除 8.修改 9.查询 10.小结 参考文献 1.入门简介 Elasticsearch 简 ...

  8. ElasticSearch快速入门

    官网地址(https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html)而且是中文的 Elastic的快速入门 1.基础 ...

  9. Cobra 快速入门 - 专为命令行程序而生

    最近一直在看 Istio(一个 Service Mesh 框架)相关的东西,当看到其源码时发现了一个新东西 Cobra,一查却发现这是个好东西,用的地方可不少,比如:Docker.Kubernetes ...

最新文章

  1. 使用fbs打包pyqt5本人亲自尝试过的
  2. Docker系列07—Dockerfile 详解
  3. MySQL TEXT数据类型的最大长度
  4. linux 的 usr 文件
  5. Android开发之基本概念
  6. Help View修复
  7. ssm项目启动,加载数据库连接池时卡住
  8. js中eval 详解
  9. Django中文无法转换成latin-1编码的解决方案
  10. c语言小型编译器编写,小型C语言编译器设计(4页)-原创力文档
  11. 多线程之CyclicBarrier工具类和Exchanger工具类
  12. Minecraft Java版1.11_Editing Java版1.11-pre1
  13. 台式计算机进入安全模式蓝屏,电脑进入安全模式蓝屏怎么办?
  14. html5 讯飞离线语音包,讯飞输入法离线语音怎么用?讯飞输入法离线语音开启方法...
  15. 使用LaTeX表示数学方程(附源码)
  16. 原版蓝光光盘加国语配音加中文字幕及解说字幕保留弹出菜单傻瓜版教程
  17. react想要子组件每次显示的时候都执行componentDidMount方法
  18. 手机锂电池充电什么时候好?
  19. 互联网行业应届待遇十一档2014
  20. bootstrap实例《一》星巴克官网

热门文章

  1. css布局方式_收藏!40 个 CSS 布局技巧
  2. 用HTML编写教学评估系统,在线教学质量评价系统的设计与实现
  3. 三星s2 硬刷Android 8,三星T710(GALAXY Tab S2 8.0)一键救砖教程,轻松刷回官方系统...
  4. 【Python】pandas模块操作大型数据集
  5. IndentationError: expected an indented block --python报错 or IndentationError:unexpected indent
  6. Python中字符串如何定义简单举例
  7. 利用python模拟菜刀反弹shell绕过限制
  8. django系列5.1--ORM对数据库的操作
  9. 程序10 VC编写批量重命名工具
  10. 洛谷P3369 普通平衡树